Solved

Access 2013 Set Property value

Posted on 2014-09-23
7
827 Views
Last Modified: 2014-09-25
I'm working on a new project to create a receiving database for our warehouse.  I have a form with a location textbox.  What I would like is to be able to double click on the text box and have it open a form that lists all my storage locations in a grid or using individual buttons for the locations.  I'd like to be able to select one or more locations and have them populate the location on the first form.  Also to change the color of the buttons to show them as in use.  I can open the form but I can't seem to get the syntax correct to send even one location back to the original form.  I'm trying to use the set property value macro function but I can also use VBA if someone can suggest a way to do this.

Thanks'
0
Comment
Question by:Mwvarner
  • 4
  • 2
7 Comments
 
LVL 36

Expert Comment

by:PatHartman
ID: 40340051
I'd like to be able to select one or more locations and have them populate the location on the first form.
Are you really trying to put multiple values into a single column?  Can you post pictures of both forms?
0
 

Author Comment

by:Mwvarner
ID: 40340096
I'll do better than that.  I'll attach the sample DB I'm using to figure this out.  Form 1 is the main for.  double click on Location and form 2 opens.  I'm trying to have the caption of the buttons set as the location on form 1.  I can't get even one button to work much less multiple locations.  However multiple locations is what I'll eventually need.

Marshall
Database11.accdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40341805
?
With no data, ..it is difficult to see what you are after here...
Can you post a "working" sample database?

JeffCoachman
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Mwvarner
ID: 40341826
This is all I have.  I'm just trying to workout how to set the value of the location box on Form1 from a button on Form2.

Clicking on the button A1 on form 2 should set the value in the location text box on Form1 to A1.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40342051
Clicking on the button A1 on form 2 should set the value in the location text box on Form1 to A1.
Then you are using the incorrect terminology.

To do what you are asking does not require "Set Property" at all,...

All you need is something like this on the button:
Private Sub CmdA1_Click()
    Forms!Form1!Location = Me.CmdA1.Caption
End Sub

...obviously, ...both forms need to be opened in order for this to work...

JeffCoachman
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 40342068
If you need this to be cumulative for multiple buttons, ...use something like this:

Private Sub CmdA1_Click()
    Forms!Form1!Location = Forms!Form1!Location & " " & Me.CmdA1.Caption
End Sub

Private Sub CmdA2_Click()
    Forms!Form1!Location = Forms!Form1!Location & " " & Me.CmdA2.Caption
End Sub

Private Sub CmdA3_Click()
    Forms!Form1!Location = Forms!Form1!Location & " " & Me.CmdA3.Caption
End Sub

Private Sub CmdA4_Click()
    Forms!Form1!Location = Forms!Form1!Location & " " & Me.CmdA4.Caption
End Sub

Private Sub CmdA5_Click()
    Forms!Form1!Location = Forms!Form1!Location & " " & Me.CmdA5.Caption
End Sub


JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40343839
;-)
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question