I am having problems with the code below because I would like to add a condition which states
If txtbox = "certain data entry"
then open form1
else open form 2
but I can not seem to get my syntax right, here is my code:
Private Sub open_estate_Click()
On Error GoTo Err_open_estate_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ESTATE"
stLinkCriteria = "[DeceasedID]=" & Me![DeceasedList]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_open_estate_Click:
Exit Sub
Err_open_estate_Click:
MsgBox Err.Description
Resume Exit_open_estate_Click
End Sub
If txtbox = "certain data entry"
then open form1
else open form 2
but I can not seem to get my syntax right, here is my code:
Private Sub open_estate_Click()
On Error GoTo Err_open_estate_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ESTATE"
stLinkCriteria = "[DeceasedID]=" & Me![DeceasedList]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_open_estate_Click:
Exit Sub
Err_open_estate_Click:
MsgBox Err.Description
Resume Exit_open_estate_Click
End Sub