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

Form Opening Help!!!

Presto731
P: 53
I have a paremeter query set up that asks you to enter a value to open it. I want the form attached to that query to ask for the same info when you open it. It does that when you click on the form from the database window. All well and good!

However my problem lies when I try to open the form from a switchboard, it just simply opens the form instead of first asking for the value

I'm sure its a simple answer I'm overlooking. I would certainly appreciate anyone's input and help. Thanks.
Jul 17 '07 #1
Share this Question
Share on Google+
4 Replies


damonreid
Expert 100+
P: 114
When you are building the button in the form (or switchboard) you need to set open criteria on the open command. Personally I prefer using a combo box to get them to select a value prior to opening the form.

Expand|Select|Wrap|Line Numbers
  1.     Dim stDocName As String
  2.     Dim stLinkCriteria As String
  3.  
  4.     stDocName = "NAME OF YOUR FORM"
  5.  
  6.     stLinkCriteria = "[NAME ON NEW FORM YOU WANT TO FILTER]=" & "'" & Me![COMBO BOX VALUE] & "'"
  7.     DoCmd.Close
  8.     DoCmd.OpenForm stDocName, , , stLinkCriteria
Jul 17 '07 #2

Presto731
P: 53
I appreciate the reply. A combo box won't actually work because the number of records is enormous!

My VB skills are lackluster at best. DOn't suppose you have an easier way! :)

Thank you though!
Jul 17 '07 #3

damonreid
Expert 100+
P: 114
You can have a blank box and let them type in a value before opening or alternatively on all combo boxes they an start typing in the value and it will autocomplete.

Either way they still have to enter the value, with a combo box it is just a little easier.
Jul 17 '07 #4

Presto731
P: 53
You can have a blank box and let them type in a value before opening or alternatively on all combo boxes they an start typing in the value and it will autocomplete.

Either way they still have to enter the value, with a combo box it is just a little easier.

Sorry. Brain Fart, You're correct. Problem solved. Thanks!
Jul 17 '07 #5

Post your reply

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