Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strlinkcriteria Using Two Fields

Status
Not open for further replies.
Mar 9, 2007
48
US
Hi all. Quick question and I'm sure it's simple but I'm not sure what else to try.
I have a form that is opening another from via a button. The code for the button is as follows:
Private Sub Data_Sheet_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ClinicFrm"
stLinkCriteria = "MRN='" & Me![MRN] & "' AND [Clinic Date_Bound] ='" & Me![Clinic Date] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "Data Sheets", acSaveYes
End Sub
When the ClinicFrm opens prompt box appears "Enter Parameter Value" Clinic Date_Bound (a bound control). I then enter the appropriate date and then it opens to the proper record in the form. I don't want to enter the prompt. What am I missing? Thanks in advance for your help.
 
You must use the names of fields, not the names of controls from the form that you are opening. It seems that [Clinic Date_Bound] is the name of a control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top