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

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 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.
 
G

Guest

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



Ofer said:
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 said:
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

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 said:
Hi , could you please tell what do I need to do?
or how it need to go?
please
Thanks.



Ofer said:
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 said:
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

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 said:
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 said:
Hi , could you please tell what do I need to do?
or how it need to go?
please
Thanks.



Ofer said:
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



:



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

Thanks Ofer..my question was answered by myself .

Ldiaz


ldiaz said:
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 said:
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 said:
Hi , could you please tell what do I need to do?
or how it need to go?
please
Thanks.



:

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



:



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
_______________________________________________________
 

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