Opening Form Using Mutiple Values From Combos

J

Jamie

I am trying to open a form to view the results from
mutiple values from a combo box. Here is the Code:


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Closed Jobs1"


stLinkCriteria = "[Technician Username]=" & "'" & Me!
[Combo13] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


At the moment it compares the value from the table
Technician Username with the Combo box Combo13 i would
like it to compare a value from another table and combo
box and show the results? Can this be done!
 
J

John Vinson

I am trying to open a form to view the results from
mutiple values from a combo box. Here is the Code:


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Closed Jobs1"


stLinkCriteria = "[Technician Username]=" & "'" & Me!
[Combo13] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


At the moment it compares the value from the table
Technician Username with the Combo box Combo13 i would
like it to compare a value from another table and combo
box and show the results? Can this be done!

Just build a bigger stLinkCriteria string: e.g.

stLinkCriteria = "[Technician Username]=" & "'" & Me!
[Combo13] & "' AND [AnotherField] = " & [SomeOtherCombo]

If the field is Numeric you shouldn't have any delimiters; if it's
text, use quotemarks in the same way as the Technician Username.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top