A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Passing two values to a form



 
 
Thread Tools Display Modes
  #1  
Old August 23rd, 2004, 11:01 AM
Andrew Wilkins
external usenet poster
 
Posts: n/a
Default Passing two values to a form

I know how to pass one value to a form using a button:

stLinkCriteria = "[DepartmentAllocation]=" & "'" & Me![Combo142] & "'"

But how can I change this code to pass two values? For example, I want to
pass not just the DepartmentAllocation value but also the CustomerName value.
Both are from combo boxes called Combo142 (for DepartmentAllocation) and
Combo152 (for CustomerName) respectively.

Can this be acheived?
  #2  
Old August 23rd, 2004, 11:15 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

Assuming that the Bound column of both combos refers to a Text type field:

stLinkCriteria = "([DepartmentAllocation]=""" & Me![Combo142] & _
""") AND ([CustomerName] = """ & Me.Combo152 & """)"


--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Andrew Wilkins" wrote in message
...
I know how to pass one value to a form using a button:

stLinkCriteria = "[DepartmentAllocation]=" & "'" & Me![Combo142] & "'"

But how can I change this code to pass two values? For example, I want to
pass not just the DepartmentAllocation value but also the CustomerName
value.
Both are from combo boxes called Combo142 (for DepartmentAllocation) and
Combo152 (for CustomerName) respectively.

Can this be acheived?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange stLinkCriteria behaviour on command button Anthony Dowd Using Forms 3 August 21st, 2004 03:01 AM
Need help filtering values in form Santa Using Forms 1 July 22nd, 2004 11:45 AM
Clearing Values in a form Haji Using Forms 2 July 9th, 2004 10:49 PM
Getting values into a form Praveen Manne General Discussion 2 June 9th, 2004 07:12 PM
average, eliminating zero values Chris Worksheet Functions 6 May 14th, 2004 11:36 PM


All times are GMT +1. The time now is 04:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.