Open Form To Blank Record

froggiebeckie

Registered User.
Local time
Today, 15:52
Joined
Oct 11, 2002
Messages
104
Hi all.
I have a problem with a form/subform.
The main form is used to select the correct record. Only the subform will be used to add data.

To keep this form user friendly, I need the main form to open up on a blank record. Then the user will select the correct record from a combo box, move to the subform and add the info.

Is there an easy way to get the main form to open to a blank record, in these conditions?

As always, thanks in advance.

BeckieO
 
Does the main form need to be bound to a query or table?
 
Hi all.
I have a problem with a form/subform.
The main form is used to select the correct record. Only the subform will be used to add data.

To keep this form user friendly, I need the main form to open up on a blank record. Then the user will select the correct record from a combo box, move to the subform and add the info.

Is there an easy way to get the main form to open to a blank record, in these conditions?

As always, thanks in advance.

BeckieO
If the combo box to select the correct record is unbound (as it should be) you could set the Data Entry property of the main form to YES and then in the After Update Event of the combo box BEFORE it does the search, set the Date Entry property to NO.
 
Sorry, should have been clearer. Right now, I've kept the db very simple. Intention is to track loans of books or manuals.

3 tables, Books, Loans, Category
Books & Loans =1 to many. Books & Category = Many to 1

In the form in question, Main form displays records from Books table.
Subform creates or modifies records in Loans table.

Every thing works, but I need to get it to open to a blank record. The folks who will be using it are new to computers, so I'm trying to keep it as clean and as I can.

Thanks
 
What's not clean about that?

You set the main form to "Data Entry" which will open to a blank record. In the After Update event, the person makes the selection that will search for and find the record they are looking for. However, in the same code, just above it you would put

Me.DataEntry = False

So then all of the records would be available for the combo to run the search code.
 
You may be able to put something like the following in the main forms on open event:

DoCmd.GoToRecord , , acNewRec

???
ken
 
What's not clean about that?

You set the main form to "Data Entry" which will open to a blank record. In the After Update event, the person makes the selection that will search for and find the record they are looking for. However, in the same code, just above it you would put

Me.DataEntry = False

So then all of the records would be available for the combo to run the search code.

You could always just have it, on the form's LOAD event use:

DoCmd.RunCommand acCmdRecordsGoToNew

instead. Although I've had error message popup at times when using that one. That's why I suggested the other way.
 
That's the Ticket

Sorry, my timing's off. My second post was a response to Ken's first question.

I followed the suggestion of Boblarson and it's working just great.

Thanks so much. This is another one I'll keep in my "memory jogger" file.

As always, you guys rock.

BeckieO
 

Users who are viewing this thread

Back
Top Bottom