Have problem with autofill part of form

Noreene

New member
Local time
Yesterday, 16:46
Joined
Jun 12, 2013
Messages
7
I have a form "frmInvoices" that is used for entering and printing invoices. This form's control source is "tblInvoices". My problem is: When I choose customerid in combobox on form, I need it to go to "tblInvoiceNumbers" and enter customerid in the field in the table, get the new invoice number (which is an autonumber that will not exist until customerid field has a value), return that new invoice number to form field "Invoice Number".

Could you help please? Thanks, Noreene
 
Sounds like your Table relationships may not be correct.

Please post a readable picture of your relationships.

Dale
 
I said that my control source was tblinvoices but I meant my record source. I tried to do this with code but can't remember how anymore. I can do a Docmd and get the tblinvoicenumbers open to new record, but can't remember how to tell it to place frmInvoices.customerid.value into the tblinvoicenumbers.customerid field and then return the new invoice number it creates to the frminvoices.invoicenumber field.

Whew..does that make sense?
 
Why is the invoice number defined in tblInvoiceNumbers rather than tblInvoice? Sounds like you may not actually need tblInvoiceNumbers and so your code behind the form will work on the bound resordset and not have to update a different table.
 
Well, DUH!! I didn't even think of that! I am going to try that. Thank you so much!
 

Users who are viewing this thread

Back
Top Bottom