I have this piece of code than runs on a form with 3 drop down boxes which the user can select from either of them and then the other form will open at the record which is specified in one of the dropdown boxes.
When i run the code it doesnt error for the first If statement but it errors for the other 2 with this error message "An expression you entered is the wrong data type for one of the arguments"
Any help would be much appreciated
Thanks
Vicky
If Me.cbo_form.Value = "Project Input" Then
If IsNull(Me.cbo_Project_id.Value) = False Then
DoCmd.OpenForm "frm_project_input"
DoCmd.GoToRecord acDataForm, "frm_project_input", acGoTo, Forms!frm_input_param.cbo_Project_id
Exit Sub
End If
If IsNull(Me.cbo_epes.Value) = False Then
DoCmd.OpenForm "frm_project_input"
DoCmd.GoToRecord acDataForm, "frm_project_input", acGoTo, Forms!frm_input_param.cbo_epes
End If
If IsNull(Me.cbo_sap.Value) = False Then
DoCmd.OpenForm "frm_project_input"
DoCmd.GoToRecord acDataForm, "frm_project_input", acGoTo, Forms!frm_input_param.cbo_sap
End If
When i run the code it doesnt error for the first If statement but it errors for the other 2 with this error message "An expression you entered is the wrong data type for one of the arguments"
Any help would be much appreciated
Thanks
Vicky
If Me.cbo_form.Value = "Project Input" Then
If IsNull(Me.cbo_Project_id.Value) = False Then
DoCmd.OpenForm "frm_project_input"
DoCmd.GoToRecord acDataForm, "frm_project_input", acGoTo, Forms!frm_input_param.cbo_Project_id
Exit Sub
End If
If IsNull(Me.cbo_epes.Value) = False Then
DoCmd.OpenForm "frm_project_input"
DoCmd.GoToRecord acDataForm, "frm_project_input", acGoTo, Forms!frm_input_param.cbo_epes
End If
If IsNull(Me.cbo_sap.Value) = False Then
DoCmd.OpenForm "frm_project_input"
DoCmd.GoToRecord acDataForm, "frm_project_input", acGoTo, Forms!frm_input_param.cbo_sap
End If