Unanswered: Upon Entering Form have Text Boxes Empty
This mysterious problem has been eluding me for days now. If you have any advice please explain in lamens terms as I am not proficient with VB.
What I am trying to achieve is when I open a form to have the text boxes in that form to be empty. Currently when I open my form the text boxes are showing the first record from my table.
What I have done in the past to get this to work is go into the properties of the text box and under the Data tab look for a data entry selection and change it to either yes or no (can't remember which). For some reason when I look at the properties in these text boxes the option is not even there.
You are right Matt..I figured this out a few minutes ago..but now I am posed with another problem.
Now when I enter the form the text boxes are blank..Superb!..but
I can't look up a record...the form is now exclusively a data entry form.
How can I have the text boxes blank upon opening the form and be able to enter new records and find records aswell??
I have a smaller database in which I can do this and have exhausted myself comparing properties from one form that works correctly to the one being stubborn..so I know that I can get both these functions to work..I just must be missing something.
Could it have anything to do with the fact that I am using a tabular layout?
I am using the code below but have a different problem. the form opens to a new record but when I use the toolbar at the bottom of the form to cycle through previous records the data does not populate. I have checked the table and the records are in there. Any ideas???
Originally posted by Rockey
you can go to a new record in the open or load event
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
or if calling form from another form
DoCmd.OpenForm "<FormNameHere>", , , , acFormAdd
I am assuming that you are talking about this code:
DoCmd.OpenForm stDocName, , , , acFormAdd
acFormAdd opens the form in DataEntry mode - only for adding new records. Same as [FormName].DataEntry = True. So Me.DataEntry = False would restore your ability to cycle through the records in the underlying datasource.