G
Guest
I am running Access 2007 (beta) and am having trouble displaying data. I
have a database with the following tables:
Product Info (with the following fields):-
ProductID (autonumber)
ProductName (Text) and Primarykey
UnitPrice (currency)
Invoice Details (with the following fields):-
Invoice ID (autonumber)
Invoice Number (text)
Invoice Date (Date/Time)
Job Completion Date (Date/Time)
RE: (Text)
Job Description (memo)
Invoice Product Info(with the following fields):-
InvoiceProductID (autonumber)
Invoice ID (number)
ProductID (number)
ProductName (text)
UnitPrice (currency)
QTY (number)
I have inserted the “Invoice Product Info†as a Subform Datasheet into
“Invoice Detailsâ€. What I am trying to achieve is, when I select
“ProductName†(Combobox) and choose from the list, that the “UnitPrice†is
automatically updated with the corresponding data from “Product Info†table.
I have the following Relationships :-
“ProductID†From “Product Info†and “Invoice Product Infoâ€
“Invoice ID†From “ Invoice Details†and “Invoice Product Infoâ€
I have selected RowSource for “ProductName (Combobox)†as “SELECT [Product
Info].ProductID, [Product Info].ProductName, [Product Info].UnitPrice FROM
[Product Info];â€.
I have set the following Properties for the combobox:-
BoundColumn property to 1.
ColumnWidth to 0;;0
This used to display the middle column of data “ProductNameâ€, but now
doesn’t, its blank.
I also inserted the following code as an event:-
Private Sub ProductName_AfterUpdate()
Me!UnitPrice = ProductName.Column(2)
To display the third column of data (UnitPrice) in the UnitPrice field.
This part has never worked.
What am I doing wrong.
have a database with the following tables:
Product Info (with the following fields):-
ProductID (autonumber)
ProductName (Text) and Primarykey
UnitPrice (currency)
Invoice Details (with the following fields):-
Invoice ID (autonumber)
Invoice Number (text)
Invoice Date (Date/Time)
Job Completion Date (Date/Time)
RE: (Text)
Job Description (memo)
Invoice Product Info(with the following fields):-
InvoiceProductID (autonumber)
Invoice ID (number)
ProductID (number)
ProductName (text)
UnitPrice (currency)
QTY (number)
I have inserted the “Invoice Product Info†as a Subform Datasheet into
“Invoice Detailsâ€. What I am trying to achieve is, when I select
“ProductName†(Combobox) and choose from the list, that the “UnitPrice†is
automatically updated with the corresponding data from “Product Info†table.
I have the following Relationships :-
“ProductID†From “Product Info†and “Invoice Product Infoâ€
“Invoice ID†From “ Invoice Details†and “Invoice Product Infoâ€
I have selected RowSource for “ProductName (Combobox)†as “SELECT [Product
Info].ProductID, [Product Info].ProductName, [Product Info].UnitPrice FROM
[Product Info];â€.
I have set the following Properties for the combobox:-
BoundColumn property to 1.
ColumnWidth to 0;;0
This used to display the middle column of data “ProductNameâ€, but now
doesn’t, its blank.
I also inserted the following code as an event:-
Private Sub ProductName_AfterUpdate()
Me!UnitPrice = ProductName.Column(2)
To display the third column of data (UnitPrice) in the UnitPrice field.
This part has never worked.
What am I doing wrong.