Open a fresh form with few details entered

thalam

Registered User.
Local time
Yesterday, 21:31
Joined
Feb 20, 2006
Messages
27
Hi there,

I am fairly new to access. I have searched high and low for help on this particular topic. Its something pretty simple, I just don't know exactly how to do it.

Basically, the user will have a client selected from the main form, when they hit the button to go to another form which has details on services done on that client at a specific date, i want the new form to have the clien'ts ID present and a fresh record present in which I can enter the date of visit, what was done, recommendation, etc.

Right now its popping the new form open with the client, but it displays the last record that was typed in that new form. Does anyone have any suggestions or ideas on this?

Thanks
 
Sorry, like I said I'm quite new to Access. This is a database that has been developed and they asked me to make a few changes for them.

I'm not sure as to what you mean by set the datamode argument to acFormAdd. I tried searching around, but no luck. Can you clarify a bit more on that please?

This is the following code I have to open that particular form:


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmLastServiceInfo1"

stLinkCriteria = "[Customer_id]=" & Me.txtCustId.value
DoCmd.OpenForm stDocName, , , stLinkCriteria

And as I said, it pops up with the customer id from the previous form, but I want it to pop up with the customer id and a new record were I can enter new information, as opposed to a form with data entered which was entered at an earlier time.
 
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
 
First of all, thanks for all your help.

I've tried what you suggested. It brings up a new record, however it does not automatically bring over the customer id from txtCustId. Do you have any thoughts on this?

Thanks.
 
I thought that might be the case. There are several solutions. If you are using ac2K+ then you can pass the information in the OpenArgs argument and set it in the OnLoad event of the next form. You can also set the control through the forms collection from the 1st form with:
Forms!frmLastServiceInfo1!txtCustomerID = Me.txtCustId
*After* you open the next form and using your txtCustomerID control name of course!
 

Users who are viewing this thread

Back
Top Bottom