Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Question About How Pull A Data Of Combobox

Discussion in 'Information Technology' started by ldiaz, Oct 28, 2005.

  1. ldiaz

    Expand Collapse

    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


    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 Sub

    MsgBox Err.Description

    Resume Exit_OpenOrders_Click

    End Sub
  2. Loading...

    Similar Threads Forum Date
    Anyone Have Any Unanswered Questions On Sikhi Or God? Sikh Sikhi Sikhism Jan 7, 2017
    Question About Translations Questions and Answers Dec 20, 2016
    Question About GGS Questions and Answers Aug 28, 2016
    Marriage And Discrimination Related Questions Blogs Mar 21, 2016
    Sikhi Questioning Faith Sikh Sikhi Sikhism Mar 3, 2016

  3. OP
    Andy Couch - UK Access User Group


    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.

Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     

Share This Page