R
RaajDave via AccessMonster.com
Hey Guys!
Following problems need to be solved:
No.1:
I have designed a data-entry form in which I put a data validation on the
click event of SAVE button, which checks if the user leaves the field blank:
If Len(txtPartyName.Text) <= 0 Then
MsgBox “party name cannot be left blank.â€,
vbinformation+vbokonly, “DataValidationâ€
Txtpartyname.setfocus
Exit sub
End if
But this code throws an error “YOU CAN’T REFERENCE A PROPERTY OR METHOD FOR A
CONTROL UNLESS THE CONTROL HAS THE FOCUS.â€
No.2:
I have also put a command button named cmdClose for cancellation of the data
entry. The code in it’s click event is as follows:
DoCmd.Close , , acSaveNo
But if user has not entered anything in the field and clicks the cmdClose, it
throws an error “THE COMMAND OR ACTION UNDO IS NOT AVAILABLE NOW.â€
Following problems need to be solved:
No.1:
I have designed a data-entry form in which I put a data validation on the
click event of SAVE button, which checks if the user leaves the field blank:
If Len(txtPartyName.Text) <= 0 Then
MsgBox “party name cannot be left blank.â€,
vbinformation+vbokonly, “DataValidationâ€
Txtpartyname.setfocus
Exit sub
End if
But this code throws an error “YOU CAN’T REFERENCE A PROPERTY OR METHOD FOR A
CONTROL UNLESS THE CONTROL HAS THE FOCUS.â€
No.2:
I have also put a command button named cmdClose for cancellation of the data
entry. The code in it’s click event is as follows:
DoCmd.Close , , acSaveNo
But if user has not entered anything in the field and clicks the cmdClose, it
throws an error “THE COMMAND OR ACTION UNDO IS NOT AVAILABLE NOW.â€