Hi
I'm not able to explain easily my whole database, however the essential info i think is, i have a table that inlcludeds selected summary data from 4 other tables. there is a field to identify which table the records come from "type".
I have a search form and would like to open one of 4 forms depending upon what the value of the type field is.
here is my code:
it seems to open the correct form, but it doesn't go to the correct field (as you can tell from the code, each table has a differently names unique identifier)
Thanks for your time
Kev
I'm not able to explain easily my whole database, however the essential info i think is, i have a table that inlcludeds selected summary data from 4 other tables. there is a field to identify which table the records come from "type".
I have a search form and would like to open one of 4 forms depending upon what the value of the type field is.
here is my code:
Code:
Private Sub Command25_Click()
Dim strFrmName As String
Dim strIDField As String
If Me!Type = "Lender" Then
strFrmName = "frmLenders"
strIDField = "LenderID"
ElseIf Me!Type = "Agent" Then
strFrmName = "frmAgent"
strIDField = "AgentID"
ElseIf Me!Type = "Service" Then
strFrmName = "frmContactDirectory"
strIDField = "ID"
Else
strFrnName = "frmLandlord"
strIDField = "LandlordID"
End If
DoCmd.OpenForm strFrmName, acNormal, "", Me!ID = strIDField, , acNormal
End Sub
it seems to open the correct form, but it doesn't go to the correct field (as you can tell from the code, each table has a differently names unique identifier)
Thanks for your time
Kev