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

display blank form for use as search form

Stang02GT
Expert 100+
P: 1,208
for the life of my i can not remember how to do this...

A co-worker asked me that when he makes a form based off of a table when he opens the form there is data from the table showing on the form. He would like the form to be blank when it is opened ( he wants no data to appear) because this it is a search form.

lol someone please refresh my memory on this


thank you in advance!
Jul 17 '07 #1
Share this Question
Share on Google+
12 Replies


missinglinq
Expert 2.5K+
P: 3,532
This should do it!
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.   DoCmd.GoToRecord , , acNewRec
  3. End Sub
Linq ;0)>
Jul 17 '07 #2

Stang02GT
Expert 100+
P: 1,208
Isn't there something in the properties i can change....


Here is a better example of what he wants to do...


He has a form he uses to search the database with, one of his feilds is Description

When the form is opened, there is already text in the description box ( it is the 1st record of the description feild in the table that the form is based off of)

I thought there was a property for the text box on the form that you could set where the box will start out blank until someone searches for something.



hopefully i didn't confuse you :}
Jul 17 '07 #3

BradHodge
Expert 100+
P: 166
You can set the Data Entry property of the form to "Yes". This will bring the form up blank until searched.

Brad.
Jul 17 '07 #4

Stang02GT
Expert 100+
P: 1,208
You can set the Data Entry property of the form to "Yes". This will bring the form up blank until searched.

Brad.


Awsome thanks much!!!!!!!!!!!!!!!!!!!!!!!!!!1
Jul 17 '07 #5

missinglinq
Expert 2.5K+
P: 3,532
If you set the Data Entry Property to Yes you'll get a blank record, but that's all you can do with the form, data entry! You'll get an error 3021, "No current record" when you try to retrieve a record!
Jul 17 '07 #6

BradHodge
Expert 100+
P: 166
Linq is definately right. I was able to get it to work on a form that was using Allen Browne's FindAsUType module, but that is a different set-up all together.

Brad.
Jul 17 '07 #7

Scott Price
Expert 100+
P: 1,384
Could be wrong here, so a few questions first. Is this a single form? Is he trying to look up the values with a text box?

If yes to both, try changing the text box to combo box (or creating a new one using the builtin wizards)...

Regards,
Scott
Jul 17 '07 #8

missinglinq
Expert 2.5K+
P: 3,532
That's not the question, Scott. The question was how could he have a form with all the controls blank when the form first opens. Doesn't matter whether the search is done with a combobox (my preference) or a textbox and a command button, Data Entry set to Yes won't work! It won't allow an existing record to be retrieved into the form.

Linq ;0)>
Jul 17 '07 #9

Scott Price
Expert 100+
P: 1,384
Sorry, Linq. I wasn't thinking of the Data Entry setting. I agree that if it's set to Yes, it won't allow record retrieval.

I was meaning that for his search control, a combo box doesn't show any initial value when the form is opened. That doesn't really address the issue either, as you pointed out, of not showing any records at all on the form.

Regards,
Scott
Jul 18 '07 #10

MMcCarthy
Expert Mod 10K+
P: 14,534
The only way to do this is to have the form unbound when opened and set the record source after the search parameters have been entered.

However, to be honest I don't think the same form should be used as the search form. Create a form to enter the search parameters and then open the form to this particular record.
Jul 18 '07 #11

Stang02GT
Expert 100+
P: 1,208
Thank you guys for all your help!! We accomplished what he was looking to do, with your help of course :)
Jul 18 '07 #12

missinglinq
Expert 2.5K+
P: 3,532
Glad we all could help!

Linq ;0)>
Jul 18 '07 #13

Post your reply

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