Question about how pull a Data of combobox

G

Guest

Hi all.
I think it's pretty easy but I don't know why it does not work with me..I
have made this question before but the answer it does not work.

I want tu pull a data from a first Form to sencond form.
the field in both first & second form are: Combobox
Combo name in first form is:combo1
Combo name in second form is:ud

source of Combo1:
SELECT Users.UserID, [LastName] & " , " & [FirstName] AS Name,
Users.Password, Users.OrderPerson, Users.ApproverPerson,
Users.ReceiverPerson, Users.AdminPerson, Users.Active FROM Users WHERE
(((Users.Active)=Yes)) Or (((Users.Active)=Yes)) ORDER BY Users.Password;

source of ud:
SELECT Users.UserID, [LastName] & " , " & [FirstName] AS Name FROM Users;


Here is the statements that I have but it does not work, could you help me
please.

Thanks.
ldiaz
(e-mail address removed)

_______________________________________________________
Private Sub OpenOrders_Click()
On Error GoTo Err_OpenOrders_Click


Dim stDocName As String
Dim stLinkCriteria As String


stDocName = "Orders" 'Data Base name

stLinkCriteria = "[ud]=" & Me![Combo1].Column(1)


DoCmd.OpenForm stDocName, , , stLinkCriteria





Exit_OpenOrders_Click:
Exit Sub

Err_OpenOrders_Click:
MsgBox Err.Description

Resume Exit_OpenOrders_Click

End Sub
_______________________________________________________
 
G

Guest

I am not sure if I fully understand your problem here. In that both your
combo boxs appear to take data from the same table Users. But here is an
example of linking to combo boxes on different forms together.

On the first form called frmOrders

You have a combo box called cboOrderId

On the second form.

You have a combo box displaying order details. The where clause links the
tow together.

SELECT [Order Details].ProductID
FROM [Order Details]
WHERE ((([Order Details].OrderID)=[Forms]![frmOrders]![cboOrderId]));

Hope this helps.

________________________________________________
 

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

Top