fabrizio19
Registered User.
- Local time
- Today, 05:13
- Joined
- Aug 9, 2012
- Messages
- 75
Combobox opens a different form with criteria inserted in the combobox
Hi everyone.
I have the following problem:
I have a form with a combobox.From this combobox I would like to trigger the openened of a different form with the name and surname of the patients selected into the combobox.
I used this vba code
Private Sub Find_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ID Patient"
stLinkCriteria = "[PTS]=" & Me.Identification
If IsNull(Me.Identification) Then
MsgBox "Put the name in the combobox", vbCritical, "Attenzione!"
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub
The problem is that when the form Id patient is already opened every thing works fine but when the Id patient form is not opened it looks like if the combobox was not able to trigger the form with the name and surname of the patients!
Why it happens?
Thanks in advance
Fabrizio
Hi everyone.
I have the following problem:
I have a form with a combobox.From this combobox I would like to trigger the openened of a different form with the name and surname of the patients selected into the combobox.
I used this vba code
Private Sub Find_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ID Patient"
stLinkCriteria = "[PTS]=" & Me.Identification
If IsNull(Me.Identification) Then
MsgBox "Put the name in the combobox", vbCritical, "Attenzione!"
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub
The problem is that when the form Id patient is already opened every thing works fine but when the Id patient form is not opened it looks like if the combobox was not able to trigger the form with the name and surname of the patients!
Why it happens?
Thanks in advance
Fabrizio
Last edited: