stLinkCriteria

  • Thread starter Thread starter khefner
  • Start date Start date
K

khefner

Guest
I have a command button that I am trying to make it do the following on click.
1) look at the value in a combo box(combo20) called (Test Case ID #)
2) Use this # to populate a form Test case creation_results from data pulled from a table.
3) This button is in the Main Menu form.

When I clik on the button I get an error message that "microsoft access cant find the field Main Menu."
Main Menu is a form not a field which is confusing me.
Would appreciate any help on this! Thanks,
Kevin

Private Sub Command29_Click()
On Error GoTo Err_Command29_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Test case creation_results"
stLinkCriteria = "[Test Case ID #]=" & " ' " & [Main Menu]![Combo20] & " ' "

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command29_Click:
Exit Sub

Err_Command29_Click:
MsgBox Err.Description
Resume Exit_Command29_Click

End Sub
 
Try this:

stLinkCriteria = "[Test Case ID #]=" & " ' " & Me.[Combo20] & " ' "
 
Ok thanks Travis that helped I think, but now access says"
openform action was cancelled. You used a method of the DOCmd object to carry out an action in VB, but then cliked cancel in a dialog box"
 

Users who are viewing this thread

Back
Top Bottom