Welcome to SPN

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

Sign Up Now!

Combo question, how drag a value from a form to another one.

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

  1. ldiaz

    ldiaz
    Expand Collapse
    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
    ldiaz@safariland.com

    _______________________________________________________
    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
    _______________________________________________________
     
  2. Loading...

    Similar Threads Forum Date
    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
    Entering into Sikhism: Questions on Reht Maryada. Blogs Oct 22, 2015
    A question about kes/hair? Blogs Oct 21, 2015

  3. Ofer

    Ofer
    Expand Collapse
    Guest

    I don't understand, are you trying to filter the combo in form 2 according to
    the selection in combo1?

    The filter you applying in the Open form command line is for the form and
    not for the combo.
    --
    If I answered your question, please mark it as an answer. That way, it will
    stay saved for a longer time, so other can benifit from it.

    Good luck



    "ldiaz" wrote:

    >
    >
    > 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
    > ldiaz@safariland.com
    >
    > _______________________________________________________
    > 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
    > _______________________________________________________
    >
     
  4. ldiaz

    ldiaz
    Expand Collapse
    Guest

    Hi , could you please tell what do I need to do?
    or how it need to go?
    please
    Thanks.



    "Ofer" wrote:

    > I don't understand, are you trying to filter the combo in form 2 according to
    > the selection in combo1?
    >
    > The filter you applying in the Open form command line is for the form and
    > not for the combo.
    > --
    > If I answered your question, please mark it as an answer. That way, it will
    > stay saved for a longer time, so other can benifit from it.
    >
    > Good luck
    >
    >
    >
    > "ldiaz" wrote:
    >
    > >
    > >
    > > 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
    > > ldiaz@safariland.com
    > >
    > > _______________________________________________________
    > > 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
    > > _______________________________________________________
    > >
     
  5. Ofer

    Ofer
    Expand Collapse
    Guest

    You didn't answer my question if its a filter for the combo.

    If you want to filter the combo in form 2 while form 1 still open, you can
    assign a filter directly to the combo refering to the field in form 1

    SELECT Users.UserID, [LastName] & " , " & [FirstName] AS Name FROM Users
    Where Users.UserID = Forms![Enter here Form1 Name]![combo1]
    ==============================================
    Or, you can pass a value to form 1 using the OpenArgs, and on the OnLoad
    event of form 2 you can assign the RowSource to the combo together with the
    filter

    DoCmd.OpenForm stDocName, , , , , , Me.Combo1

    On the Load event of form 2 write

    Me.ud.RowSource = "SELECT Users.UserID, [LastName] & " , " & [FirstName] AS
    Name FROM Users Where Users.UserID = " & Me.openArgs

    --
    If I answered your question, please mark it as an answer. That way, it will
    stay saved for a longer time, so other can benifit from it.

    Good luck



    "ldiaz" wrote:

    > Hi , could you please tell what do I need to do?
    > or how it need to go?
    > please
    > Thanks.
    >
    >
    >
    > "Ofer" wrote:
    >
    > > I don't understand, are you trying to filter the combo in form 2 according to
    > > the selection in combo1?
    > >
    > > The filter you applying in the Open form command line is for the form and
    > > not for the combo.
    > > --
    > > If I answered your question, please mark it as an answer. That way, it will
    > > stay saved for a longer time, so other can benifit from it.
    > >
    > > Good luck
    > >
    > >
    > >
    > > "ldiaz" wrote:
    > >
    > > >
    > > >
    > > > 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
    > > > ldiaz@safariland.com
    > > >
    > > > _______________________________________________________
    > > > 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
    > > > _______________________________________________________
    > > >
     
  6. ldiaz

    ldiaz
    Expand Collapse
    Guest

    Hi Ofer..
    first Option work fine,,thank you so much, just I have peding how put the
    value as default because when I open the second form , the ud is in Blank but
    with the data in filter but I need to select it .

    Thanks.

    "Ofer" wrote:

    > You didn't answer my question if its a filter for the combo.
    >
    > If you want to filter the combo in form 2 while form 1 still open, you can
    > assign a filter directly to the combo refering to the field in form 1
    >
    > SELECT Users.UserID, [LastName] & " , " & [FirstName] AS Name FROM Users
    > Where Users.UserID = Forms![Enter here Form1 Name]![combo1]
    > ==============================================
    > Or, you can pass a value to form 1 using the OpenArgs, and on the OnLoad
    > event of form 2 you can assign the RowSource to the combo together with the
    > filter
    >
    > DoCmd.OpenForm stDocName, , , , , , Me.Combo1
    >
    > On the Load event of form 2 write
    >
    > Me.ud.RowSource = "SELECT Users.UserID, [LastName] & " , " & [FirstName] AS
    > Name FROM Users Where Users.UserID = " & Me.openArgs
    >
    > --
    > If I answered your question, please mark it as an answer. That way, it will
    > stay saved for a longer time, so other can benifit from it.
    >
    > Good luck
    >
    >
    >
    > "ldiaz" wrote:
    >
    > > Hi , could you please tell what do I need to do?
    > > or how it need to go?
    > > please
    > > Thanks.
    > >
    > >
    > >
    > > "Ofer" wrote:
    > >
    > > > I don't understand, are you trying to filter the combo in form 2 according to
    > > > the selection in combo1?
    > > >
    > > > The filter you applying in the Open form command line is for the form and
    > > > not for the combo.
    > > > --
    > > > If I answered your question, please mark it as an answer. That way, it will
    > > > stay saved for a longer time, so other can benifit from it.
    > > >
    > > > Good luck
    > > >
    > > >
    > > >
    > > > "ldiaz" wrote:
    > > >
    > > > >
    > > > >
    > > > > 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
    > > > > ldiaz@safariland.com
    > > > >
    > > > > _______________________________________________________
    > > > > 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
    > > > > _______________________________________________________
    > > > >
     
  7. ldiaz

    ldiaz
    Expand Collapse
    Guest

    Thanks Ofer..my question was answered by myself .

    Ldiaz


    "ldiaz" wrote:

    > Hi Ofer..
    > first Option work fine,,thank you so much, just I have peding how put the
    > value as default because when I open the second form , the ud is in Blank but
    > with the data in filter but I need to select it .
    >
    > Thanks.
    >
    > "Ofer" wrote:
    >
    > > You didn't answer my question if its a filter for the combo.
    > >
    > > If you want to filter the combo in form 2 while form 1 still open, you can
    > > assign a filter directly to the combo refering to the field in form 1
    > >
    > > SELECT Users.UserID, [LastName] & " , " & [FirstName] AS Name FROM Users
    > > Where Users.UserID = Forms![Enter here Form1 Name]![combo1]
    > > ==============================================
    > > Or, you can pass a value to form 1 using the OpenArgs, and on the OnLoad
    > > event of form 2 you can assign the RowSource to the combo together with the
    > > filter
    > >
    > > DoCmd.OpenForm stDocName, , , , , , Me.Combo1
    > >
    > > On the Load event of form 2 write
    > >
    > > Me.ud.RowSource = "SELECT Users.UserID, [LastName] & " , " & [FirstName] AS
    > > Name FROM Users Where Users.UserID = " & Me.openArgs
    > >
    > > --
    > > If I answered your question, please mark it as an answer. That way, it will
    > > stay saved for a longer time, so other can benifit from it.
    > >
    > > Good luck
    > >
    > >
    > >
    > > "ldiaz" wrote:
    > >
    > > > Hi , could you please tell what do I need to do?
    > > > or how it need to go?
    > > > please
    > > > Thanks.
    > > >
    > > >
    > > >
    > > > "Ofer" wrote:
    > > >
    > > > > I don't understand, are you trying to filter the combo in form 2 according to
    > > > > the selection in combo1?
    > > > >
    > > > > The filter you applying in the Open form command line is for the form and
    > > > > not for the combo.
    > > > > --
    > > > > If I answered your question, please mark it as an answer. That way, it will
    > > > > stay saved for a longer time, so other can benifit from it.
    > > > >
    > > > > Good luck
    > > > >
    > > > >
    > > > >
    > > > > "ldiaz" wrote:
    > > > >
    > > > > >
    > > > > >
    > > > > > 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
    > > > > > ldiaz@safariland.com
    > > > > >
    > > > > > _______________________________________________________
    > > > > > 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
    > > > > > _______________________________________________________
    > > > > >
     

Share This Page