473,388 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

How to open a sub form with command button

I have a Search form "SearchF" with 2 fields Equipment # and Location.

I build the query "SearchQ" with criteria
Expand|Select|Wrap|Line Numbers
  1. (Like "*" & [Forms]![SearchF]![Equipment #] & "*")
and
Expand|Select|Wrap|Line Numbers
  1. (Like "*" & [Forms]![SearchF]![Location] & "*")
Then I built the form "SearchQF"

The search button is in the main form. I have the sub form "results". The command works great using vba
Expand|Select|Wrap|Line Numbers
  1. Private Sub Searchbar_Click()
  2. Me!Results.Form.RecordSource = "SearchQ"
  3. End Sub
The only thing is I do not want to see the sub form when I open the search form (datasheet view). I want the sub form hidden until I hit the search button in the main form.

Can anyone help?
Aug 22 '19 #1
1 1382
NeoPa
32,556 Expert Mod 16PB
You have two main options :
  1. Make the SubForm Control (That is a Control and not the form itself.) invisible.
  2. Set which Form is used in the SubForm Control only when you want it to be viewed.
Aug 23 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: William Bradley | last post by:
Following is the code I am using, behind a command button, on a form to print out only the report of that particular form. ******************** Code Start ************************ Dim strDocName...
9
by: Melissa | last post by:
What is the code to delete a command button from a form? Can the code be run from the click event of the button to be deleted? Thanks! Melissa
1
by: Steve Patrick | last post by:
Hi All Looking for a code to make a command button close a welcome form and then open a switchboard form. Need step by step if possible - as complete newbie here. Thanks for any / all help....
4
by: Mr. T | last post by:
Hi, I need some help here. I have a On Exit procedure on that opens a form. Whenever anyone clicks anything outside of it the form opens. No problem here. But I need it not to open if the...
2
by: Nothing | last post by:
Anyone know how to make the LIKE command work in the following OpenForm command? DoCmd.OpenForm "frmSearchResults", , , " = '" & bbid & "'" This will work if I type the whole bid #, but if I...
1
by: Pete Straman Straman via AccessMonster.com | last post by:
Hey: I have created a module that runs fine. I am trying to put all my modules on a form. I cannot get the modules to run from the command buttons. The error I get is Compiler error: ...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
14
by: keri | last post by:
Hi, Simple version of the question..... How do I use the where clause of the open form command to show an account with a matching ID to be displayed when the form is opened? Eg. I select a...
6
by: martin DH | last post by:
**Urgent Need** I'll throw out the basics and any assistance is very, very, very much appreciated! Access 2003 on XP On a form (frmMain) is an option group of check boxes (ReportFrame) from...
10
by: Beatrice | last post by:
I need to open a form selecting all data from a previous form i.e: Form 1) combo box 1 named "cboYearSelect" displayed as "Year" based on qry QryYearList ( only one field "Year") ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.