By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,057 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,057 IT Pros & Developers. It's quick & easy.

Command Button on a Search Form

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.