Solved

Access 2013 Set Property value

Posted on 2014-09-23
7
753 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 34

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

762 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now