Solved

Access 2013 Set Property value

Posted on 2014-09-23
7
786 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 35

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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

815 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

8 Experts available now in Live!

Get 1:1 Help Now