HELP with an INSERT INTO statement

  • Thread starter Franc Sutherland
  • Start date
F

Franc Sutherland

Hello everyone,

I received the response below for a previous question. I understand the
logic behind the reply, and I am sure it will work. I can't, however, figure
out what I should be substituting for '2345' in the "SELECT '2345' AS" part
of the solution below?

I'm getting very close to running out of time and would greatly appreciate
any assistance.

Regards,

Franc.

Hi Franc,
 
J

John W. Vinson

Hello everyone,

I received the response below for a previous question. I understand the
logic behind the reply, and I am sure it will work. I can't, however, figure
out what I should be substituting for '2345' in the "SELECT '2345' AS" part
of the solution below?

I'm getting very close to running out of time and would greatly appreciate
any assistance.

Regards,

Franc.

Hi Franc,

You would put whatever value you want inserted into the CreditNoteID. Since we
can't see your database, it's more than a bit difficult for us to ascertain
what that might be!

You say elsethread that you have a different ID for the Credit Notes. Where is
that ID defined? How do you (in the real world) identify which Credit Note
goes with which Order?

John W. Vinson [MVP]
 
F

Franc Sutherland

Hi John,

Fair point. Sorry if I haven't been clear enough.

In my database, the credits have their own table, the credit_id is the kay
and is autonumber. The sales_id number is a foreign key. The sales data is
pulled through into a new credit using the after-update event of a combo box
which lists sales orders. Is this how you would set up creditn notes?
Would you have them as part of the sales order instead?

From your reply, I think I may have got it. The '2345' could be a control
reference from the form I'm using to generate the credit? e.g.
Forms!frm_new_credit!credit_id or similar.

Thanks again for all your help John. I hope I didn't offend you by asking
for help with your reply. Reading it back, it makes perfect sense. I'm
still finding my feet with VBA and get a bit lost sometimes.

Regards,

Franc.
 
J

John W. Vinson

From your reply, I think I may have got it. The '2345' could be a control
reference from the form I'm using to generate the credit? e.g.
Forms!frm_new_credit!credit_id or similar.

Exactly. Sounds like you're on the right track.
Thanks again for all your help John. I hope I didn't offend you by asking
for help with your reply. Reading it back, it makes perfect sense. I'm
still finding my feet with VBA and get a bit lost sometimes.

<g> It takes a LOT more than that to offend me. Microsoft releasing Lookup
Fields and multivalued fields for example...<g>

John W. Vinson [MVP]
 
Top