DLookup from other DLookup

Y

yanz

Hi,
Can I possibly make DLookup that lookup from another textbox that already
using DLookup to show the record.

1st textbox: =DLookUp("[CustomerID]","[Registration]","[RoomID]='" &
cboNoRoomOccupied.Column(0) & "'")

2nd textbox need to make show CustomerGender that the CustomerID is equal to
CustomerID from 1st textbox.

Thank you.
 
A

AccessVandal via AccessMonster.com

Hi,

Since the two textboxes are unbound, and if the "cboNoRoomOccupied" row
source includes the fields "CustomerID and the "Gender"... why not just use
the textbox control source like

Textbox1 =[cboNoRoomOccupied].Column(1) ' assuming 1 is the RoomID

Textbox2 =[cboNoRoomOccupied].Column(2) ' assuming 2 is the customer Gender
Hi,
Can I possibly make DLookup that lookup from another textbox that already
using DLookup to show the record.

1st textbox: =DLookUp("[CustomerID]","[Registration]","[RoomID]='" &
cboNoRoomOccupied.Column(0) & "'")

2nd textbox need to make show CustomerGender that the CustomerID is equal to
CustomerID from 1st textbox.

Thank you.
 
Y

yanz

Thanks for the quick reply.

It's become problem when my cboNoRoomOccupied retrieve data from table Room
which is contain RoomID.

My first textbox lookup CustomerID from table Registration with RoomID from
table Registration equal to RoomID from table Room.

My second textbox lookup CustomerID from different table which is table
Customers with CustomerID equal to CustomerID from table Registration.

Can it will be possible anyway?

AccessVandal via AccessMonster.com said:
Hi,

Since the two textboxes are unbound, and if the "cboNoRoomOccupied" row
source includes the fields "CustomerID and the "Gender"... why not just use
the textbox control source like

Textbox1 =[cboNoRoomOccupied].Column(1) ' assuming 1 is the RoomID

Textbox2 =[cboNoRoomOccupied].Column(2) ' assuming 2 is the customer Gender
Hi,
Can I possibly make DLookup that lookup from another textbox that already
using DLookup to show the record.

1st textbox: =DLookUp("[CustomerID]","[Registration]","[RoomID]='" &
cboNoRoomOccupied.Column(0) & "'")

2nd textbox need to make show CustomerGender that the CustomerID is equal to
CustomerID from 1st textbox.

Thank you.
 
A

AccessVandal via AccessMonster.com

Hi,

Yes, it's possible. Use the combobox rowsource to select both tables like..

Select col1,........,Table1.customerID,Table2.RoomID From Table1, Table2
Thanks for the quick reply.

It's become problem when my cboNoRoomOccupied retrieve data from table Room
which is contain RoomID.

My first textbox lookup CustomerID from table Registration with RoomID from
table Registration equal to RoomID from table Room.

My second textbox lookup CustomerID from different table which is table
Customers with CustomerID equal to CustomerID from table Registration.

Can it will be possible anyway?
[quoted text clipped - 17 lines]
 
A

AccessVandal via AccessMonster.com

Update

Your SQL syntax should look something like this.

SELECT Registration.CustomerID, Room.RoomID, Customers.Gender FROM
Registration, Room, Customers WHERE Registration.CustomerID = Customers.
CustomerID AND Registration.RoomID = Room.RoomID

If you use the Access Built button “…†the syntax is slightly different from
above. It would be something like…


SELECT Registration.CustomerID, Room.RoomID, Customers.Gender FROM
(Registration INNER JOIN Registration.CustomerID = Customers.CustomerID)
INNER JOINT Registration.RoomID = Room.RoomID;

HTH
 
A

Andy Hull

Hi

If CustomerID is numeric, use...
dlookup("[CustomerGender]", "[Customers]", "[CustomerID] = " &
Me.FirstTextBox)

If CustomerID is text, use...
dlookup("[CustomerGender]", "[Customers]", "[CustomerID] = '" &
Me.FirstTextBox & "'")

Regards

Andy Hull
 

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

DLookup in Continuous form 0
Using Min Function within DLookup Function 0
Dlookup problem 6
Nesting DLOOKUPs 7
Dlookup table/form problem 2
dlookup problem 4
DLookup in subform 11
DLookup in CrossTabQuery form 6

Top