By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

Conditional format help.

P: 18
I am building another data base for invoices. I have two tables on is for the invoices, one is for the parts.

The invoice table contains several fields. for the customer info and for the orders to be stored in.

The Part table consists of fields
part #
Serial #
description
Price

The form that I created for the invoice, i want to have conditional formatiing for the part info for example:

When part # 001 is selected from the drop down box that is connected to the part table then it automatically fills in the serial description and price into the appropriate fields on the form. I then want the price field multiplied multiplied by the quanity field to bring a total. into the total field. Then a sub total at the bottom.

If anyone can help me with how to do this it would be greatly appreciate. Oh yeah I am running with MS ACCESS 2000. If any further info is needed let me know.

Thanks a lot
May 8 '07 #1
Share this Question
Share on Google+
16 Replies


Rabbit
Expert Mod 10K+
P: 12,347
You could just set the control source of the textboxes to DLookup the appropriate fields.
May 8 '07 #2

P: 18
You could just set the control source of the textboxes to DLookup the appropriate fields.
But would it automatically look up the info. They are different fields?
May 8 '07 #3

Rabbit
Expert Mod 10K+
P: 12,347
But would it automatically look up the info. They are different fields?
It would automatically lookup whenever your combobox changes because the control source would be tied to the value of the combobox.
May 8 '07 #4

P: 18
It would automatically lookup whenever your combobox changes because the control source would be tied to the value of the combobox.
I'm sorry but I dont think that I am understanding. The first field on the form is a combo box which is the part #, the next field would be a text box which is serial number, the next is a text/ description and the next is text box/ price.

Do I do the dlookup on the combo box or the text box... and what exactly do I put in for the appropriate field.

Again Sorry I am fairly new to this.
May 8 '07 #5

Rabbit
Expert Mod 10K+
P: 12,347
I'm sorry but I dont think that I am understanding. The first field on the form is a combo box which is the part #, the next field would be a text box which is serial number, the next is a text/ description and the next is text box/ price.

Do I do the dlookup on the combo box or the text box... and what exactly do I put in for the appropriate field.

Again Sorry I am fairly new to this.
You'd put it in the control source property of the textbox. You'll want to look up the DLookup function in the help files as that'll provide you an explanation of all the intricacies and examples.
May 8 '07 #6

P: 18
You'd put it in the control source property of the textbox. You'll want to look up the DLookup function in the help files as that'll provide you an explanation of all the intricacies and examples.
But the control source needs to point to where I want the data stored. I am more looking for an After Update type thing. Just dont know what to put.
May 8 '07 #7

JConsulting
Expert 100+
P: 603
But the control source needs to point to where I want the data stored. I am more looking for an After Update type thing. Just dont know what to put.

in the after update event of your combo box

me.mytextfield = me.mycombo.column(x)

where x is the appropriate field you're trying to populate.

J
May 8 '07 #8

MMcCarthy
Expert Mod 10K+
P: 14,534
Set the Row Source of the combo box to ...
Expand|Select|Wrap|Line Numbers
  1. SELECT  [part #], [Serial #], description, Price FROM Part
You can hide the extra columns by setting their column width to 0.

Then in the After Update event of the combo box put the following:

Expand|Select|Wrap|Line Numbers
  1. Private Sub ComboboxName_AfterUpdate()
  2.    Me![Serial #] = Me!ComboboxName.Column(1)
  3.    Me!description = Me!ComboboxName.Column(2)
  4.    Me!Price = Me!ComboboxName.Column(3)
  5. End Sub
Mary
May 8 '07 #9

MMcCarthy
Expert Mod 10K+
P: 14,534
in the after update event of your combo box

me.mytextfield = me.mycombo.column(x)

where x is the appropriate field you're trying to populate.

J
Congratulations on the new status J.
May 8 '07 #10

JConsulting
Expert 100+
P: 603
Congratulations on the new status J.
Thank you!!
They still haven't shown me the secret handshake ;)
J
May 8 '07 #11

MMcCarthy
Expert Mod 10K+
P: 14,534
Thank you!!
They still haven't shown me the secret handshake ;)
J
Sshh! It's a secret.

Send me a PM if you need anything.

Mary
May 8 '07 #12

Rabbit
Expert Mod 10K+
P: 12,347
Thank you!!
They still haven't shown me the secret handshake ;)
J
<_<
>_>

/whispers It's up, up, down, down, left, right, left, right, B, A
May 9 '07 #13

P: 18
Set the Row Source of the combo box to ...
Expand|Select|Wrap|Line Numbers
  1. SELECT  [part #], [Serial #], description, Price FROM Part
You can hide the extra columns by setting their column width to 0.

Then in the After Update event of the combo box put the following:

Expand|Select|Wrap|Line Numbers
  1. Private Sub ComboboxName_AfterUpdate()
  2.    Me![Serial #] = Me!ComboboxName.Column(1)
  3.    Me!description = Me!ComboboxName.Column(2)
  4.    Me!Price = Me!ComboboxName.Column(3)
  5. End Sub
Mary

Thank you for that. I keep getting an error though. It takes me to the debugger and Highlights the Me!Serial = Me!Part_Number1.Column(1) it says that the serial is null. But there is data in that Field
May 9 '07 #14

P: 18
Thank you for that. I keep getting an error though. It takes me to the debugger and Highlights the Me!Serial = Me!Part_Number1.Column(1) it says that the serial is null. But there is data in that Field

Expand|Select|Wrap|Line Numbers
  1. Private Sub Part_Number1_AfterUpdate()
  2.    Me!Serial = Me!Part_Number1.Column(1)
  3.    Me!Description = Me!Part_Number1.Column(2)
  4.    Me!Price = Me!Part_Number1.Column(3)
  5. End Sub
That is the code that I have set up. The field names in the table are
Part number
serial
description
price

the combobox name on the table is
Part Number1

Followed by text boxes
Serial
Description
Price

After I select the Part Number1 I want the other fields to fill in automatically.

The error that I am getting is "Run time error '2465' MS Access cannot find the field 'Part_Number1' refered to in your expression."

It then gives me the option to Debug,
When you go to the debugger, Me!Serial = Me!Part_Number1.Column(1) is highlighted and when you mouse over it says "Me!Serial = Null" but there is data in that field
May 9 '07 #15

P: 18
Never mind everyone I found the problem... It was the space in the name of the combo box. Thank you all for all of your Help I love you guys
May 9 '07 #16

MMcCarthy
Expert Mod 10K+
P: 14,534
Never mind everyone I found the problem... It was the space in the name of the combo box. Thank you all for all of your Help I love you guys
You're welcome.
May 9 '07 #17

Post your reply

Sign in to post your reply or Sign up for a free account.