Making a subform popup/disappear with a button

Which property and methods do I want to address with VBA in order to make a subform popup at the bequest of a button command and to make it it disappear after the database advances to the next record?
9XqUwH3SAsked:
Who is Participating?
 
wiswalldCommented:
Forms!mainform.subform.form.visible = false  'or true
0
 
Rey Obrero (Capricorn1)Commented:
subform popup ??? are you referring to a subform inside a form or an independent form?

Forms!NameOfForm.setfocus
docmd.close
0
 
mbizupCommented:
In addition to wiswalld's comment, you would use code in the Current Event of your main form to make this happen as the user goes from record to record.

The Current Event fires when the form first opens, and whenever the user moves to a noe record.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
9XqUwH3SAuthor Commented:
Alas, I include too little information.
I want a simple subform or form to popup when I press a button. However, I want to make sure that the combo box on the subform enters the selection into the field on the main form.
[I'm so grateful for your patience.]
I've  included  my 2 forms and my relationships. Feel free to draw on them.
I'm saving these projects to study. I learn best by reverse-study, so I am duly grateful for your extra instruction.
Earnestly,
Steve
Akron, OH

Main-Form.jpg
PopUp-Form.JPG
Relationships.JPG
0
 
9XqUwH3SAuthor Commented:
Do I need to work on my tables before I procede? And do the suggestions you gave, above, still apply, here?
0
 
wiswalldCommented:
So create the pop up form and open like this

DoCmd.openform "formname", acNormal, , "[autonumber]=  " & Me.Autonumber
0
 
9XqUwH3SAuthor Commented:
Let me backup a step or two: Can a subform or a form that is connected to a main form exist separate (not embedded) from the main form?
0
 
wiswalldCommented:
Yes

You can have a pop up form and open like I stated above. The form will open to the related record.
0
 
9XqUwH3SAuthor Commented:
Thank you.
0
 
mbizupCommented:
I lost track of this one...

<Can a subform or a form that is connected to a main form exist separate (not embedded) from the main form?>

If the "connection" you are referring to is the Master/Child link that synchronizes an embedded subform with it's parent, then the answer is "no". These links exist only between a main form, and an embedded "Subform Control". Subforms are simply another type of control placed on your form with their own set of properties that include these data links.

The workaround when using a seperate popup form is to write code to control the popup form's current record from the main form. wiswalld showed you how to open a popup form to a specific record. You can also write code to change the popup form's record to match the record in the main form.

That said, I personally find that for that level of control (completely synchronizing a main form with a popup), an embedded subform is a better option. If space is an issue there is always the option of using a tab control and embedding the subform on a seperate tab on the same form.
0
 
9XqUwH3SAuthor Commented:
You are thorough.
I suspected that was the case but now, I have that confidence.
You are appreciated.
I am growing in my knowledge of all of this.
Say, do you know off-hand a good  'canned code' website? When you come across one, can you append to this thread?
Thanks for the enthusiasm. What propelled you toward mastery? What 'kept you at-it', so to speak?
Where you a hobbiest prior to being professional?
0
 
mbizupCommented:
This is a good reference and tutorial for SQL Syntax (just bear in mind that this is not specifically Access SQL, and some of the examples will not work in an Access environment):
http://www.1keydata.com/sql/sql.html

General Access and VBA tutorials with plenty of sample code:
http://www.functionx.com/vbaccess/index.htm
http://www.blueclaw-db.com/accessvisualbasic/

If you are a hands-on learner, Microsoft has some good templates for A2K7:
http://office.microsoft.com/en-us/templates/CT101426161033.aspx

Also, some of our Experts have posted samples that answer many FAQ's:
http://www.databasedevelopment.co.uk/examples.htm  (LPurvis)
http://www.thenelson.name/    (thenelson)

Another great resource for samples:
http://www.lebans.com/
0
 
mbizupCommented:
<What propelled you toward mastery? .... Where you a hobbiest prior to being professional?>

Mastery might be overdoing it :-). I'm the office IT "gofer" because I enjoy solving problems.

My formal training was in Electrical Engineering with a focus on Digital Design. I got into Software Engineering just because that was where all the jobs were at the time (late '80's) - there was a real need for programmers and few to go around. So I'm mostly self-taught.

<What 'kept you at-it', so to speak?>
I found that I liked programming a lot better than the hardware stuff I went to school for.

In terms of EE, I love written communication and technical writing.

I've also learned a lot from reading and asking questions here myself, so paritcipating as an Expert is simply giving back. I've been able to share a lot of the concepts that I've learned here myself.

A very enjoyable aspect of participating in an online technical community is passing on your interpretation of what you've learned and seeing that get passed along to others in other threads.

I described that to someone recently as being like modern-day, high-tech storytelling. That is *very* cool and is a major driving factor that keeps me contributing.
0
 
9XqUwH3SAuthor Commented:
Hmmh. It's discouraging to hear how so many college/university graduates find themselves doing crazy things.
We all try to find our path and/or survive as best we can.
I'm wondering if I'm learning in the right way or if I'm going to be smart enough (I should be but am getting a little concerned).
Do you remember your first day of high school and you didn't know where you were and you might have forgotten your locker combination and you couldn't find study hall! That's how I feel about VBA code, alone  --  even tho I have some excellent materials.
I thing the Adult ADHD I take medication for is still getting the best of me. I can't afford to live and go to school with my disability so this is terning out to be an affordable education.
I had a skilled trade that I can no longer practice, for health reasons. I'm without skills and didn't fair well in the trade for which I wasn't suited well for. Therefore, I'm embarking on what I expect to be a short-term cleaning business. I can certainly use automation from the Office System.
Anyway, I'm sure I'll paths will cross on this site. Nice talking with you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.