Hi Everyone,
I have a problem with Access that I can't seem to solve:
I have a sub form recordset changing acording to the value of a drop down box.
I tried this code:
But when I goto tick one of the boxes in the subform I get the error:
and then this error when I try to save the record or move out of that form etc.
Is it because the recordset has no records in it? It will only ever have a maximum of one records, but obviously if nothing has been set - then no record will exist (empty recordset).
Can anyone help?
Thanks
I have a problem with Access that I can't seem to solve:
I have a sub form recordset changing acording to the value of a drop down box.
I tried this code:
Code:
Private Sub comboPatronTypeSelect_Change()
If Me.comboPatronTypeSelect.Value = "" Or Me.comboPatronTypeSelect.Value = Null Then
''''''''''''''''''''' do nothing ''''''''''''''''
Else
Me.lblSelectPatronType.Visible = False
End If
Debug.Print "patronType value: " & Me.comboPatronTypeSelect.Value
'setup the variables.
Dim strLicenceID_FK, strPatronType As String
strLicenceID_FK = Me.licenceID.Value
strPatronType = Me.comboPatronTypeSelect.Value
' setup the select for this patron type
Dim strSQL As String
strSQL = "SELECT * FROM ssel_web_erm_tblLicencePermissions WHERE licenceID_FK = '" & strLicenceID_FK & _
"' AND patronType = '" & strPatronType & "'"
Debug.Print strSQL
Form_frmLicencePermissions_sub.RecordSource = strSQL
End Sub
and then this error when I try to save the record or move out of that form etc.
Is it because the recordset has no records in it? It will only ever have a maximum of one records, but obviously if nothing has been set - then no record will exist (empty recordset).
Can anyone help?
Thanks
Comment