Getting selected record from "Search Part" pop up form to main form (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 20:43
Joined
Sep 21, 2011
Messages
14,047
See the smiley icon, two to the right of the link icon in the toolbar for your post.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:43
Joined
Sep 21, 2011
Messages
14,047
Hey I think it's his hobby - no hassle - Thank you for the naming conventions & hints n tips - working on it now (arghhh!)
I'll let you know if I get there :)
Let's see if you can get there before Mike :D
 

Linda1503

Member
Local time
Today, 20:43
Joined
Sep 3, 2021
Messages
77
I am so :poop: at this :rolleyes: thanks for all the help 😘
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:43
Joined
Sep 21, 2011
Messages
14,047
Yes, naming conventions might be lacking, but that is not going to solve her issue?
However, just like crossposting, advising of the true nature of the query, is a matter of common courtesy, and certainly for anyone on UA wishing to help, linda's posts are a lot clearer here as to the problem, than yours on UA?

DB is too recent for me to open, so I can only help out in theory. :(
 

Linda1503

Member
Local time
Today, 20:43
Joined
Sep 3, 2021
Messages
77
Okay, got the thing to work but have 1 (hopefully) SMALL problem...
I need to use VBA on click of a button to do it - But I had been using that button to close the form via a macro.
I hate to admit this but I have NEVER (despite trying) managed to close a form using VBA.
So the button is on the form I want to close...
The name of the form is "ProdSrchFRM"...
The code I have fails on the DoCmd.Close - what on earth am I doing wrongggggg
Also not sure where that line should be to allow the Else bit to do it's bit...
Please help
Ps. Mike60smart - not great to post my DB without asking...
 

Attachments

  • Close.JPG
    Close.JPG
    52.2 KB · Views: 87

isladogs

MVP / VIP
Local time
Today, 20:43
Joined
Jan 14, 2017
Messages
18,186
Add a close button and add code to its click event: DoCmd.Close.
Or if that doesn't work for some reason, use DoCmd.Close acForm, Me.Name
 

Linda1503

Member
Local time
Today, 20:43
Joined
Sep 3, 2021
Messages
77
Add a close button and add code to its click event: DoCmd.Close.
Or if that doesn't work for some reason, use DoCmd.Close acForm, Me.Name
From post above:
So the button is on the form I want to close...
The name of the form is "ProdSrchFRM"...
The code I have fails on the DoCmd.Close - what on earth am I doing wrongggggg
Also not sure where that line should be to allow the Else bit to do it's bit...
Close.JPG
 

isladogs

MVP / VIP
Local time
Today, 20:43
Joined
Jan 14, 2017
Messages
18,186
You don't refer to the current form by using its actual name there.
Type in EXACTLY what I wrote before!

BTW you don't need the acSaveYes part unless you have changed the form DESIGN. New/edited records are saved automatically.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:43
Joined
Sep 21, 2011
Messages
14,047
You would use Me.Name in that case
 

Users who are viewing this thread

Top Bottom