Open new record with selected fields from previous record

D

Design by Sue

I have a form that includes about 15 fields of information. There is a
search that locates previous records based on an Auto Number field (called
ID). The search results are displayed on the form.

I am trying to create a button that will open the form to a new record which
will have 3 of the fields filled in based on the search results. I have
created a query that will give the results but it has been a while since I
worked in Access and I can't remember how to link to query to the opening of
a new record. OR do I need to write the SQL directly in the button coding and
if so can you get me started on the coding).

Again it has been a while since working with Access, but I used to know how
to do this stuff! Thanks for any assistance.

Sue
 
C

Chegu Tom

In your button click event,

store the three text boxes to variables
move to a new record
Write the saved values in the new record (via the text boxes on the form).

strVariable1=me.text1
strVariable2=me.text2
strVariable3=me.text3

DoCmd.GoToRecord , , acNewRec

me.text1=strVariable1
etc
 
D

Design by Sue

Thanks - I will try it later today!

Sue

Chegu Tom said:
In your button click event,

store the three text boxes to variables
move to a new record
Write the saved values in the new record (via the text boxes on the form).

strVariable1=me.text1
strVariable2=me.text2
strVariable3=me.text3

DoCmd.GoToRecord , , acNewRec

me.text1=strVariable1
etc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top