Automatically filling a form for some records based on another for

G

Guest

I have created a form to enter records for invoicing for shipment of trucks.
It includes the cost of the matl shipped the quantity, client id, client
address, dates, and some calculations of ex. cost*quantity of matl. There is
a step previous to this where some companies are receiving a quote based on
which would fill some(most-not all) of the fields for this form. I would
like the existing form (Invoice Entry) to have a drop down for a QuoteID and
have it fill the ex. cost, quantiy etc. Not all of the Invoice Entry records
will have had a quoteid or a quote for them and they would need to be
manually input. I am getting confused do both the QuoteForm and the Invoice
Entry form have to have the same field names ex. cost, quantiy, etc. and how
can it fill for only some of the records and how can I let the user input for
the other records. Do I have to go through ALL of my calc. and put the form
name in front of all ex. cost fields???

Confused -
Thanks,
Barb
 
G

Guest

It depends what you want.
All you really need in the invoice record is the quote id which links to the
quote table. If you want to have the data from the quote record actually
placed in the invoice record, you need to handle that yourself. When a quote
is selected, you will need to set up an event procedure to go out and pull
the data from the quote record and place it in the desired form controls. The
quote control would be an unbound combo box and its rowsource would be the
quotes table.
Presumably there is some way to relate invoice records to quote records (by
company name or something).

Dorian
 
G

Guest

What would the event procedure look like? where do you put the event
procedure ? on each field or can you add a string after update for the quote
id from the drop down. the quote id would be the common field however not
every record for the invoice may have a quote id. quote id is primary in the
quote table but the invoice # is primary for the invoice table.

Thanks,
Barb
 
G

Guest

Still need help????

Thanks

babs said:
What would the event procedure look like? where do you put the event
procedure ? on each field or can you add a string after update for the quote
id from the drop down. the quote id would be the common field however not
every record for the invoice may have a quote id. quote id is primary in the
quote table but the invoice # is primary for the invoice table.

Thanks,
Barb
 
G

Guest

Did the pull data from the quote record- when just did it with the cost field
it worked great with not errors. Than added the rest and have problems -
anything wrong with the If code???????

See Below:

Private Sub cbquoteid_AfterUpdate()
If (Me.cbquoteid <> 0) Then
[cost] = Me.cbquoteid.Column(8)
[ClientId] = Me.cbquoteid.Column(2)
[Job] = Me.cbquoteid.Column(4)
[Divisor] = Me.cbquoteid.Column(5)
[GrossWeight] = Me.cbquoteid.Column(6)
[Pit] = Me.cbquoteid(7)
[TaxRate] = Me.cbquoteid(9)
[FuelperRate] = Me.cbquoteid(10)
[Markup] = Me.cbquoteid(11)
[OverallMarkup] = Me.cbquoteid(12)
[CartageRate] = Me.cbquoteid(13)
[AltCartageRate] = Me.cbquoteid(14)
[nontax] = Me.cbquoteid(16)
End If
End Sub

Please help!

Thanks so much,
Barb
 

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