Passing selected record data to another form/text box

CK_One

Registered User.
Local time
Today, 10:20
Joined
May 10, 2016
Messages
11
Hi All,

Not sure if this has already been covered, if so you can point me in the right direction.

I have created a stock tracking data base but would like to incorporate a shipping proforma form that can be printed, emailed and recorded.

I would like to create a button on the asset list form that passes the selected record data OEM brand, OEM model and description to the equivalent text boxes in the shipping proforma form. Need to be able list multiple records in text boxes.

I have attached screen shots of the forms I am referring to so you get a better understanding.

Any suggests on how this can be done?

CK_One
 

Attachments

  • Shipping Performa Form.jpg
    Shipping Performa Form.jpg
    88.6 KB · Views: 199
  • Asset List Form.jpg
    Asset List Form.jpg
    99.1 KB · Views: 203
Your stock record has a unique ID so all you need to do is append the matching fields to your Proforma Table - you could do this using a append qry that runs when your button is pressed and put the where condition into the query to only append the matching ID from your form?
 
Hi Minty,

Thanks for your reply and apologies for the late response. Been on holiday haven't had the chance to try your suggestion.

I have created the append query below but was not sure how to add the where condition for the unique ID.

INSERT INTO Assets ( [Ship OEM Brand], [Ship OEM Model], [Ship Description] )
SELECT Assets.[OEM Brand], Assets.[OEM Model], Assets.Description
FROM Assets;

As it stands, when I run the query the data is not added to the list box in the Shipping Proforma form.

I also need to link this query to a button. Any ideas how that can be done?

Kind regards,
 
That query possibly won't work or insert a record for every record in Assets. The format is
Code:
INSERT INTO [I]YourTargeTable[/I] (Field1, Field2, Fieldx) 
SELECT Field1, Field2, Fieldx FROM YourSourceTable
WHERE AFieldInYourSource = WhateverYourCriteriaIs

If your source table has a autonumber PK field you don't need to refer to it as it will be automatically assigned.
 

Users who are viewing this thread

Back
Top Bottom