limit new records on form

JSDART

Registered User.
Local time
Today, 23:16
Joined
Nov 20, 2000
Messages
18
HI I have a form that begins with a parameter Q thast asks for last name or 1st initial if you just enter with nothing it gives you all the records. When you enter D and there are no Ds yo9u get a blank record and I have a command button that takes you to add a new record. The issue is that I only want the users to enter a new record in this manner not with the add record on the toolbar at bottom of the form. So I set the allow additin property to no.
this works but now when I enter D and there is no D I get a grey form and no way to get at my add new record button.
Any Suggestions
thanks JSDART
 
I'm not totally with you JSDART but try setting the Allow Additions back to YES and set the Navigation Buttons to NO.

This will then force your user to use your command button although you'll need to guard against the mouse wheel and Edit Menu methods as well to make it anyway secure.
 
Thanks I tried that.
It does force them to use my command button, and my parameter runs ok for if they use the last name But if they use 1st initial or there is more then 1 person with the same last name they can not tell that or go to the proper record.
I guess I have to choose the least offensive of the limits unless someone knows the way around both.
Thanks
 
I got it to work!!!!
I limited the Allow Addition to NO
then added Code to the on open event

With CodeContextObject
If (.RecordsetClone.RecordCount = 0) Then
DoCmd.Close
MsgBox "There are No Records that Match entered Criteria", vbOKonly, "No Records"
DoCmd.OpenForm "frm-initial client"
End If
End With

End Sub

I was able to find other assists from the Site. This site is Fantastic
Thanks
JSDART
 

Users who are viewing this thread

Back
Top Bottom