S
Sue R via AccessMonster.com
I have taken over a db and do not know VB, so I would appreciate any help
with this. A form opens to add information for a new contact. there is a
button on the form that is to automatically add a Reference ID. When I click
the button I get the message 'Run-time error'91' Object variable or With
block variable not set. This is the Debug info with rsMain.Requery
hightlighted.
Sub modSetReferenceID(frmMain As Form, strIDValue1 As String, strIDValue2 As
String, txtReference As TextBox)
rsMain.Requery
txtReference.SetFocus
If txtReference.Text = "" Then
If rsMain.RecordCount <= 8 Then
txtReference.Value = strIDValue1 & rsMain.RecordCount + 1
Else
txtReference.Value = strIDValue2 & rsMain.RecordCount + 1
End If
End If
End Sub
Thanks for any help
sue
with this. A form opens to add information for a new contact. there is a
button on the form that is to automatically add a Reference ID. When I click
the button I get the message 'Run-time error'91' Object variable or With
block variable not set. This is the Debug info with rsMain.Requery
hightlighted.
Sub modSetReferenceID(frmMain As Form, strIDValue1 As String, strIDValue2 As
String, txtReference As TextBox)
rsMain.Requery
txtReference.SetFocus
If txtReference.Text = "" Then
If rsMain.RecordCount <= 8 Then
txtReference.Value = strIDValue1 & rsMain.RecordCount + 1
Else
txtReference.Value = strIDValue2 & rsMain.RecordCount + 1
End If
End If
End Sub
Thanks for any help
sue