Wrong Value loaded into form... why?

J

Jorge

Hello

I have a form created that contains a code field that looks into another
table for the cost of a service. Whenever the user enters another CODE into
the form it looks at the
ServiceCode table for the ServiceCharge. The first one works - when a user
selects the ServiceCode field and chooses
the price gets pulled. But when they go to the Code1 field (it looks to the
ServiceCode table) and pulls the actual ServiceCode, not the ServiceCharge.

What am I doing wrong?

table:Employee
Emp#
EmpFname
EmpLname
EmpPhone

table: ServiceCode
ServiceCode
ServiceDesc
ServiceCharge

table: Receive
Receive#
RecFname
RecLname
RecPhone
ServiceCode
Code1
Code2
Code3
Code4
Code5
Emp#

Please help me...
 
J

John Vinson

The first one works - when a user
selects the ServiceCode field and chooses
the price gets pulled. But when they go to the Code1 field (it looks to the
ServiceCode table) and pulls the actual ServiceCode, not the ServiceCharge.

What am I doing wrong?

I don't know. What's the Control Source of the combo box that pulls
Code1? What are the RowSource and Bound Column properties of the
combo?

Note that any table with fields named Code1, Code2, Code3 and Code4 is
almost certainly not properly normalized: you appear to have a one to
many relationship embedded within each row.
 
J

Jorge

Sir

inline

John Vinson said:
I don't know. What's the Control Source of the combo box that pulls
Code1? What are the RowSource and Bound Column properties of the
combo?

The control source is code1 - code1 looks to Services for the combo.
Row Source says SELECT Services.*, [ServiceCharges].[ServiceCharge] FROM
Services INNER JOIN ServiceCharges ON
[Services].[ServiceCode]=[ServiceCharges].[ServiceCode];
Bound Column says 1

Does this help?
 
J

John Vinson

The control source is code1 - code1 looks to Services for the combo.
Row Source says SELECT Services.*, [ServiceCharges].[ServiceCharge] FROM
Services INNER JOIN ServiceCharges ON
[Services].[ServiceCode]=[ServiceCharges].[ServiceCode];
Bound Column says 1

Does this help?

And what do you want to store into field [Code1]? As written, you're
selecting Services.* - "all fields in the Services table" - and the
ServiceCharge field from the related ServiceCharges table; and you're
storing the first column of the Services table, whatever that is (I'm
guessing ServiceCode).

If you want to store the service *CHARGE* into the Code1 field, your
naming convention is confusing at best - but to do so you would want
to remove the * column from the query.
 

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

Similar Threads


Top