Open new record with selected fields from previous record

  • Thread starter Thread starter Design by Sue
  • Start date Start date
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
 
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
 
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
 
Back
Top