A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

pass fields to pop up form



 
 
Thread Tools Display Modes
  #1  
Old September 9th, 2009, 06:08 PM posted to microsoft.public.access
deb
external usenet poster
 
Posts: 898
Default pass fields to pop up form

I have a main form called fEdit and a subform called fEditDetails.
fEditDetails form has many buttons. If the user chooses btn10 a popup form
is displayed with an area the user can make a note why he selected btn 10.

If user clicks button btn10 a pop up form called fEditPopUp is displayed.
I need to automatically populate the popup form with EditDetailsID and the
number 10.

How can I autopopulate the popup with the EditDetailsID into EditDetailsID
field and the number 10 in the ListID field?

Thanks



--
deb
  #2  
Old September 9th, 2009, 06:43 PM posted to microsoft.public.access
Dale Fye
external usenet poster
 
Posts: 2,651
Default pass fields to pop up form

To pass the value of the button that was pushed, you could use the OpenArgs
parameter of the OpenForm method. It is the last parameter in the parameter
list. Then, in the forms Open event, check to see if there is a OpenArg
value and if so, put it in the appropriate field of that form.

If fEditPopup is bound to a table that contains the EditDetailsID field,
then you can pass that as the WhereCondition parameter of the OpenForm
method. It might look like:

Private sub Btn10_Click

strCriteria = "[EditDetailsID] = " & me.txt_EditDetailsID
strOpenArgs = 10
docmd.OpenForm "fEditPopUp",,,strCriteria,,,strOpenArgs

End Sub

If fEditPopup is not bound, then you might want to pass both values in
strOpenArgs (separated by a comma or semi-colon). Then, in the forms Open or
Load event, use the Split() function to parse the two elements of OpenArgs
and then put the values in the appropriate fields.

----
HTH
Dale



"deb" wrote:

I have a main form called fEdit and a subform called fEditDetails.
fEditDetails form has many buttons. If the user chooses btn10 a popup form
is displayed with an area the user can make a note why he selected btn 10.

If user clicks button btn10 a pop up form called fEditPopUp is displayed.
I need to automatically populate the popup form with EditDetailsID and the
number 10.

How can I autopopulate the popup with the EditDetailsID into EditDetailsID
field and the number 10 in the ListID field?

Thanks



--
deb

  #3  
Old September 9th, 2009, 07:16 PM posted to microsoft.public.access
deb
external usenet poster
 
Posts: 898
Default pass fields to pop up form

Thank you
I tried what you send but.

This passed the EditDetailsID as 10. I need EditDetailsID to be sent to
EditDetailsID and the number 10 sent to ListID

I amnot sure how to user Split() . Can you spell it out for me.

This is the first time trying to send data to a pop up form.

Thanks
--
deb


"Dale Fye" wrote:

To pass the value of the button that was pushed, you could use the OpenArgs
parameter of the OpenForm method. It is the last parameter in the parameter
list. Then, in the forms Open event, check to see if there is a OpenArg
value and if so, put it in the appropriate field of that form.

If fEditPopup is bound to a table that contains the EditDetailsID field,
then you can pass that as the WhereCondition parameter of the OpenForm
method. It might look like:

Private sub Btn10_Click

strCriteria = "[EditDetailsID] = " & me.txt_EditDetailsID
strOpenArgs = 10
docmd.OpenForm "fEditPopUp",,,strCriteria,,,strOpenArgs

End Sub

If fEditPopup is not bound, then you might want to pass both values in
strOpenArgs (separated by a comma or semi-colon). Then, in the forms Open or
Load event, use the Split() function to parse the two elements of OpenArgs
and then put the values in the appropriate fields.

----
HTH
Dale



"deb" wrote:

I have a main form called fEdit and a subform called fEditDetails.
fEditDetails form has many buttons. If the user chooses btn10 a popup form
is displayed with an area the user can make a note why he selected btn 10.

If user clicks button btn10 a pop up form called fEditPopUp is displayed.
I need to automatically populate the popup form with EditDetailsID and the
number 10.

How can I autopopulate the popup with the EditDetailsID into EditDetailsID
field and the number 10 in the ListID field?

Thanks



--
deb

  #4  
Old September 9th, 2009, 07:34 PM posted to microsoft.public.access
Dale Fye
external usenet poster
 
Posts: 2,651
Default pass fields to pop up form

What did you try, the first recommendation, or the 2nd?

If you are trying the second, you might do something like:

Private Sub btn10_Click

Dim strOpenArgs as string

strOpenArgs = me.txt_EditDetailsID & ";" & "10"
docmd.openform "fEditPopUp",,,,,,strOpenArgs

End Sub

Then, in the Load event of fEditPopUp, you might do something like:

Private sub Form_Load

Dim strArray(2) as string

strArray = Split(me.Openargs, ";")

me.txt_EditDetailsID = strArray(0)
me.txt_ListID = strArray(1)

End Sub

----
HTH
Dale



"deb" wrote:

Thank you
I tried what you send but.

This passed the EditDetailsID as 10. I need EditDetailsID to be sent to
EditDetailsID and the number 10 sent to ListID

I amnot sure how to user Split() . Can you spell it out for me.

This is the first time trying to send data to a pop up form.

Thanks
--
deb


"Dale Fye" wrote:

To pass the value of the button that was pushed, you could use the OpenArgs
parameter of the OpenForm method. It is the last parameter in the parameter
list. Then, in the forms Open event, check to see if there is a OpenArg
value and if so, put it in the appropriate field of that form.

If fEditPopup is bound to a table that contains the EditDetailsID field,
then you can pass that as the WhereCondition parameter of the OpenForm
method. It might look like:

Private sub Btn10_Click

strCriteria = "[EditDetailsID] = " & me.txt_EditDetailsID
strOpenArgs = 10
docmd.OpenForm "fEditPopUp",,,strCriteria,,,strOpenArgs

End Sub

If fEditPopup is not bound, then you might want to pass both values in
strOpenArgs (separated by a comma or semi-colon). Then, in the forms Open or
Load event, use the Split() function to parse the two elements of OpenArgs
and then put the values in the appropriate fields.

----
HTH
Dale



"deb" wrote:

I have a main form called fEdit and a subform called fEditDetails.
fEditDetails form has many buttons. If the user chooses btn10 a popup form
is displayed with an area the user can make a note why he selected btn 10.

If user clicks button btn10 a pop up form called fEditPopUp is displayed.
I need to automatically populate the popup form with EditDetailsID and the
number 10.

How can I autopopulate the popup with the EditDetailsID into EditDetailsID
field and the number 10 in the ListID field?

Thanks



--
deb

  #5  
Old September 9th, 2009, 08:54 PM posted to microsoft.public.access
deb
external usenet poster
 
Posts: 898
Default pass fields to pop up form

On this... I get a compiler error - Can't Assign to array

Dim strArray(2) As String

strArray = Split(Me.OpenArgs, ";")

Me.DetailsID = strArray(0)
Me.ListID = strArray(1)



--
deb


"Dale Fye" wrote:

What did you try, the first recommendation, or the 2nd?

If you are trying the second, you might do something like:

Private Sub btn10_Click

Dim strOpenArgs as string

strOpenArgs = me.txt_EditDetailsID & ";" & "10"
docmd.openform "fEditPopUp",,,,,,strOpenArgs

End Sub

Then, in the Load event of fEditPopUp, you might do something like:

Private sub Form_Load

Dim strArray(2) as string

strArray = Split(me.Openargs, ";")

me.txt_EditDetailsID = strArray(0)
me.txt_ListID = strArray(1)

End Sub

----
HTH
Dale



"deb" wrote:

Thank you
I tried what you send but.

This passed the EditDetailsID as 10. I need EditDetailsID to be sent to
EditDetailsID and the number 10 sent to ListID

I amnot sure how to user Split() . Can you spell it out for me.

This is the first time trying to send data to a pop up form.

Thanks
--
deb


"Dale Fye" wrote:

To pass the value of the button that was pushed, you could use the OpenArgs
parameter of the OpenForm method. It is the last parameter in the parameter
list. Then, in the forms Open event, check to see if there is a OpenArg
value and if so, put it in the appropriate field of that form.

If fEditPopup is bound to a table that contains the EditDetailsID field,
then you can pass that as the WhereCondition parameter of the OpenForm
method. It might look like:

Private sub Btn10_Click

strCriteria = "[EditDetailsID] = " & me.txt_EditDetailsID
strOpenArgs = 10
docmd.OpenForm "fEditPopUp",,,strCriteria,,,strOpenArgs

End Sub

If fEditPopup is not bound, then you might want to pass both values in
strOpenArgs (separated by a comma or semi-colon). Then, in the forms Open or
Load event, use the Split() function to parse the two elements of OpenArgs
and then put the values in the appropriate fields.

----
HTH
Dale



"deb" wrote:

I have a main form called fEdit and a subform called fEditDetails.
fEditDetails form has many buttons. If the user chooses btn10 a popup form
is displayed with an area the user can make a note why he selected btn 10.

If user clicks button btn10 a pop up form called fEditPopUp is displayed.
I need to automatically populate the popup form with EditDetailsID and the
number 10.

How can I autopopulate the popup with the EditDetailsID into EditDetailsID
field and the number 10 in the ListID field?

Thanks



--
deb

  #6  
Old September 9th, 2009, 09:23 PM posted to microsoft.public.access
deb
external usenet poster
 
Posts: 898
Default pass fields to pop up form


Tried and it works

If Me.NewRecord Then
Me.[DetailsID] = Split(Me.OpenArgs, "$")(0)
Me.[ListID] = Split(Me.OpenArgs, "$")(1)
End If
--
deb


"deb" wrote:

On this... I get a compiler error - Can't Assign to array

Dim strArray(2) As String

strArray = Split(Me.OpenArgs, ";")

Me.DetailsID = strArray(0)
Me.ListID = strArray(1)



--
deb


"Dale Fye" wrote:

What did you try, the first recommendation, or the 2nd?

If you are trying the second, you might do something like:

Private Sub btn10_Click

Dim strOpenArgs as string

strOpenArgs = me.txt_EditDetailsID & ";" & "10"
docmd.openform "fEditPopUp",,,,,,strOpenArgs

End Sub

Then, in the Load event of fEditPopUp, you might do something like:

Private sub Form_Load

Dim strArray(2) as string

strArray = Split(me.Openargs, ";")

me.txt_EditDetailsID = strArray(0)
me.txt_ListID = strArray(1)

End Sub

----
HTH
Dale



"deb" wrote:

Thank you
I tried what you send but.

This passed the EditDetailsID as 10. I need EditDetailsID to be sent to
EditDetailsID and the number 10 sent to ListID

I amnot sure how to user Split() . Can you spell it out for me.

This is the first time trying to send data to a pop up form.

Thanks
--
deb


"Dale Fye" wrote:

To pass the value of the button that was pushed, you could use the OpenArgs
parameter of the OpenForm method. It is the last parameter in the parameter
list. Then, in the forms Open event, check to see if there is a OpenArg
value and if so, put it in the appropriate field of that form.

If fEditPopup is bound to a table that contains the EditDetailsID field,
then you can pass that as the WhereCondition parameter of the OpenForm
method. It might look like:

Private sub Btn10_Click

strCriteria = "[EditDetailsID] = " & me.txt_EditDetailsID
strOpenArgs = 10
docmd.OpenForm "fEditPopUp",,,strCriteria,,,strOpenArgs

End Sub

If fEditPopup is not bound, then you might want to pass both values in
strOpenArgs (separated by a comma or semi-colon). Then, in the forms Open or
Load event, use the Split() function to parse the two elements of OpenArgs
and then put the values in the appropriate fields.

----
HTH
Dale



"deb" wrote:

I have a main form called fEdit and a subform called fEditDetails.
fEditDetails form has many buttons. If the user chooses btn10 a popup form
is displayed with an area the user can make a note why he selected btn 10.

If user clicks button btn10 a pop up form called fEditPopUp is displayed.
I need to automatically populate the popup form with EditDetailsID and the
number 10.

How can I autopopulate the popup with the EditDetailsID into EditDetailsID
field and the number 10 in the ListID field?

Thanks



--
deb

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.