Full Version: Pop Up form to supply value
UtterAccess Forums > Microsoft® Access > Access Forms
kappler
I would like to pass data/value selected in a popup form
back to a control on the calling form as follows:
User to double click the control on main form and a popup
form appears from which user can select a value, press return
(or double click) and have that info appear in the control on the
main form.
Is such a routine possible ?
K
norie
This is possible see the attached file.
kappler
Norie
Thank you for your reply.
Odidn't quite work the way your
sample shows because I think I have
omitted 2 important pieces of information.
The double click calling control is a combo
box and secondly the calling form is a subform.
I think the latter point is rectified by
Forms!frmTest!sfOrders.Form!Code = Me!List0.Value
I almost feel your reply will be negative and that this
routine will not work because of the combo box. I
hope you can tell me otherwise.
K
norie
K
It should work for a combobox.
In my example open the form in design view, right click the text box and select Change to>Combobox.
Now open the form. Does the other form get displayed when you double click the combobox?
By the way I'm not quite sure what you mean about the subform.
Subforms are actually forms in their own right, they only 'become' subforms when they are placed as such in another form.
Norie
sredworb
Hi K,
See if this is what you are trying to do.
Jerry
check Attachment
kappler
Jerry
Have sorted it out. All to do with bound column
on both calling and return forms. I always make
that kind of error.
Thank you very much for your solution and quick
response.
K
AccDB4Free
Jerry,
think I have the same concern with K.
I have also a pop up form showing me a value from my table, and that value (92) I want to put in my fields (TransVal1, Transval2, etc..)
How can I do that, am playing around with your approach but could not make it work to my db.
Can you help me get work to my db please.
See attached for more details.
thank you,
ca
sredworb
Hi Ca,
Can you attach your db to take a look.
Jerry
AccDB4Free
Hi Jerry,
fcourse, give me time to strip off some datas, it is a running system of secondary school.
Thank you in advance,
ca
sredworb
O.K.,
erry
AccDB4Free
Hi Jerry,
Here we go.. I attached herewith the stripped off db..
Thank you again,
ca
sredworb
Hi AccDB4Free
Take a look and see if this is what you wanted.
Jerry
AccDB4Free
Hi Jerry,
Have downloaded the DB, how should it work?..
When I double click the field TransValue1, it gives me the "Run-Time Error 2450"
Microsoft Office Access can't find the form "frmGradeLookup" referred to in a macro expression of Visual Basic Code.
When I click debug, it goes to Visual Basic Windows and highlighted the below code:
---
Private Sub TransValue1_DblClick(Cancel As Integer)
Me.TransValue1 = Forms!frmGradeLookup.GradeValue
End Sub
---
What should I do,
ca
sredworb
WoW...It worked perfect for me, this is what you wanted right?
sredworb
I just tried it again it's working for me..
select a student from the combo box to populate the form then I click on View transmute value, then do the test rating, get the grade value and then double click on the cell TransValue1 and Viola!..check the screen shot.
AccDB4Free
Hello Jerry,
After reading your steps, then I found it is working for me also.
Sorry for my ignorance, just learling.
So now, do I need to duplicate all the codes through out the remaining pages?
Jerry thank you thank you again,
I want not imagine how will get through all these, thank you.
One thing more, you can see that I have a CANCEL button right of the view transmute value, my intention actually is when opening the form the subform is hiding until I click the CANCEL button and have a selection of YES/NO, if cancel is YES, then clears all entry on the main form,close the form, but if cancel is NO, then it will show the subform ready to receive inputs.. can you please help me to make that CANCEL button works, please.
Thank you,
ca
AccDB4Free
Hi Jerry,

Ogot the code for the remaining pages to work..

Thank you,
ca

Edited by: AccDB4Free on Mon May 22 14:32:47 EDT 2006.
sredworb
Hi Acc,
Glad I could help with your main problem.
Are you saying you want a message box to pop when the cancel button is clicked?
Jerry
AccDB4Free
Hello Jerry,
Yes, a message box to pop with YES/NO button to either Yes=cancel entries in main form, No=to continue and it should show my subform to enable the entries..
Would appreciate very your time,
ca
sredworb
Hi Ca,
Try this, I made it so if you click Cancel, it will clear the entries and close the form if Yes is selected. If no is selected the form stays open and the information still present.
When you click on View Transmute Value the Subform becomes visible and the Test Rating form opens.
This way seems to make a little more sense then what you have described.
Your way would be to have the user click cancel just to see the subform to work with...If they never click cancel they will never see the subform.
Maybe I am wrong, Take a look and see if this fits your needs.
Jerry
AccDB4Free
Hi Jerry,
any thanks, I will look the db and come back to you soon.
Oagree with you, the way you design is much better, well my approach is a mere beginner, thanks for redesigning.
Again, many thanks,
ca
sredworb
Hi Ca,
Glad I could Help...
Jerry
AccDB4Free
Hello Jerry,
Sorry I wasn't able to come back sooner, actually I was on the phone with the user asking the status.
Yes fantastic, it is working perfect!.
Just a small refinement maybe if you still allow me asking more help..
What I wanted to do is, if I clicked the "CLEAR" button, I want also to close the small form (the one displying the grade value,when clicking get value button). Am using the below code but, it give me run-time error '13': Type Mismatch, and on clicking the debug button it highlight the "DoCmd.Close" line..
code
------
Private Sub cmdClear_Click()
Me.cboTestItem = ""
Me.TestScore = ""
Me.Requery
DoCmd.Close "frmGradeLookup" (frmGradeLookup is the name of small popup form)
End Sub
-----
However if this approach is not good, then let it be.
Thank you,
ca
sredworb
Easy Enough,
Here ya go..
Jerry
AccDB4Free
Jerry,
Thanks again, so I just missed "acForm," what is this mean anyway?
Hey Jerry, promise one last thing, have you ever try to click the "get value" button without puting any values on those two textboxes? I do by accident and found out again new error, it is on the SQL statement by this time.
Otried removing one-by-one those "(, )" but things just go more complicated.
Can you please take a look.
Thanks Jerry,
ca
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.