Dlookup table/form problem

  • Thread starter Thread starter Mik
  • Start date Start date
M

Mik

Could somebody please assist with the following problem:-

I have a form named “Add or Delete a Customer” which has many fields.
Two of the fields are named “CustomerName”, and “Comment”.

The information within this form is stored on a table named
“Customer”.

Now, there is another form, named “Add and Edit Orders” where a
customer name can be selected from a combo-box field named
“CustomerID”. A second field on this form is named “Comment”.

What i would like to achieve is … when the the Customer is chosen from
the “CustomerID” combo-box, the comment is automatically shown in the
“Comment” field within the “Add an Order and Details” form.

The idea is that each customer has there own comment display field.

Have tried using a DLOOKUP, but failed.
Is this the best way or ???

Thanks
Mik
 
Mik

Use the column property of the combo box

In the combo-box on your Add an Order and Details form add another column to
your drop down list. In this column place the comment field. You will need
to change the number of columns in the combo box properties.

Now suppose your Comment column is the third column of your combo box. you
would then add the following code in the After Update event of the
CustomerID

Me!Comment=CustomerID.column(2)
Note although the Commnet is in the third column of the combobox the
numbering starts at 0 for the first column.

Lookup the Column Proerty for more information

Allan


Could somebody please assist with the following problem:-

I have a form named “Add or Delete a Customer” which has many fields.
Two of the fields are named “CustomerName”, and “Comment”.

The information within this form is stored on a table named
“Customer”.

Now, there is another form, named “Add and Edit Orders” where a
customer name can be selected from a combo-box field named
“CustomerID”. A second field on this form is named “Comment”.

What i would like to achieve is … when the the Customer is chosen from
the “CustomerID” combo-box, the comment is automatically shown in the
“Comment” field within the “Add an Order and Details” form.

The idea is that each customer has there own comment display field.

Have tried using a DLOOKUP, but failed.
Is this the best way or ???

Thanks
Mik
 
Mik

Use the column property of the combo box

In the combo-box on your Add an Order and Details form add another columnto
your drop down list. In this column place the comment field. You will need
to change the number of columns in the combo box properties.

Now suppose your Comment column is the third column of your combo box. you
would then add the following code in the After Update event of the
CustomerID

Me!Comment=CustomerID.column(2)
Note although the Commnet is in the third column of the combobox  the
numbering starts at 0 for the first column.

Lookup the Column Proerty for more information

Allan


Could somebody please assist with the following problem:-

I have a form named “Add or Delete a Customer” which has many fields.
Two of the fields are named “CustomerName”, and “Comment”.

The information within this form is stored on a table named
“Customer”.

Now, there is another form, named “Add and Edit Orders” where a
customer name can be selected from a combo-box field named
“CustomerID”. A second field on this form is named “Comment”.

What i would like to achieve is … when the the Customer is chosen from
the “CustomerID” combo-box, the comment is automatically shown in the
“Comment” field within the “Add an Order and Details” form.

The idea is that each customer has there own comment display field.

Have tried using a DLOOKUP, but failed.
Is this the best way or ???

Thanks
Mik


Many Thanks
Just what i was hoping for.

Mik
 
Back
Top