Solved

Access 2013 Set Property value

Posted on 2014-09-23
7
777 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
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.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

861 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

25 Experts available now in Live!

Get 1:1 Help Now