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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|