473,387 Members | 2,436 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,387 software developers and data experts.

Command Button on a Search Form

I need a search form to perform. I have a Form and a subform. The
subform is based off a query and the main form is unbound. The query
runs perfect, however, I have a command button in the main form with
the [Event Procedure] code:

Private Sub Command12_Click()
Me.Refresh
End Sub

That command button is not working and gives me the prompt, "Error
accessing network drive". What drive? I'm not connected to a network!
Also, if I try to see the Visual Basic, it doesn't give me a window.
It's the command button that is killing me. Half the time I can't even
get in to see the code!

How do you guys get your Main Form to communicate with your subform to
put out the results matching the criteria? Is there another command
button I can use that simply tells the Subform to run off the criteria
selection in the main form???

P.S. I'm not good at all at reading/understanding code, I do it all
mostly from design view.

Jan 23 '07 #1
1 3423
Chris wrote:
>I need a search form to perform. I have a Form and a subform. The
subform is based off a query and the main form is unbound. The query
runs perfect, however, I have a command button in the main form with
the [Event Procedure] code:

Private Sub Command12_Click()
Me.Refresh
End Sub

That command button is not working and gives me the prompt, "Error
accessing network drive". What drive? I'm not connected to a network!
Also, if I try to see the Visual Basic, it doesn't give me a window.
It's the command button that is killing me. Half the time I can't even
get in to see the code!

How do you guys get your Main Form to communicate with your subform to
put out the results matching the criteria? Is there another command
button I can use that simply tells the Subform to run off the criteria
selection in the main form???

Refresh is the wrong method to use for this. Refresh check's
for other user changes to records in the form's recordset.
Obviously(?) this makes no sense in an unbound form. Use
the Requery method instead.

In addition, you need to tell the method that you want to
requery the subform:

Me.[subform control name].Requery

--
Marsh
Jan 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Bolus | last post by:
I'm a teacher using MS Access on an RMConnect 2.4 network. On some workstations both I and my students sometimes get an error message when attempting to insert a command button on a form which...
0
by: Steve Bishop | last post by:
I have a form with a search text box and a grid that displays the results. Within the grid, I have edit command links set up to response.redirect to another page that puts the DataKey value in the...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
7
by: Mindy | last post by:
Hey, on the form, I set up a "Search" button, which is a command button. After a user select the city and state on the form , and hit the "search" button, I hope another form will show up...
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...
4
by: Alex Chun | last post by:
How can I program a command button on a form to bring up the standard "Find and Replace" dialog on click? Separate but related: how do you run menu commands (e.g. "Edit" "Find") from VB? ...
0
by: aviklund | last post by:
Hi, I made a simple data access page with a search button that does work properly, but now I would like to add a filtering to the command button also. Ideal solution would be like this: ...
4
by: QntmPg | last post by:
Hi all I am trying to design a database that holds contact/demographic information on a person and what studies they have participated in. I have a few ideas, but wanted to get feedback on...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.