473,385 Members | 1,402 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,385 software developers and data experts.

display blank form for use as search form

Stang02GT
1,208 Expert 1GB
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
12 5172
missinglinq
3,532 Expert 2GB
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
1,208 Expert 1GB
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
166 Expert 100+
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
1,208 Expert 1GB
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
3,532 Expert 2GB
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
166 Expert 100+
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
1,384 Expert 1GB
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
3,532 Expert 2GB
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
1,384 Expert 1GB
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
14,534 Expert Mod 8TB
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
1,208 Expert 1GB
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
3,532 Expert 2GB
Glad we all could help!

Linq ;0)>
Jul 18 '07 #13

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

Similar topics

5
by: Batezz | last post by:
I have created a form (below) How do I stop it redirecting to another page (productsearchresults.php) when form is submitted if both the fields are blank? Any help appreciated. Batezz
8
by: dmcconkey | last post by:
Hi folks, I have a client with four websites. Each site has a contact form that is identical. They all have "required" fields validated through a JavaScript onSubmit() function. Upon validation,...
6
by: HartSA | last post by:
Here is the relevent part of my code. I am trying to learn ASP. <body> <table border="0" cellspacing="0" cellpadding="0"> <form name="frmSearch1a" method="get"> <tr> <td align=center>...
6
by: Andy | last post by:
Hello, I am having many problems with setting up a parameter query that searches by the criteria entered or returns all records if nothing is entered. I have designed an unbound form with 3...
0
by: visionstate | last post by:
Hi there, I have a form which has 2 text boxes, a combo box and a sub form in it (which reads from a query. The query reads from the table). On load, I would like the fields in the text boxes and...
2
by: kev | last post by:
Hi Folks, I have created a search query in which it successfully returns correct results. When there are no records returned, instead of giving out a blank form i created a pop-up msg which is...
0
by: peridian | last post by:
Hi, I wanted a web page where I could post code to, and have it appear in coloured formatting based on the context of the code. Most of the techniques I have seen for this involve complex use...
10
by: KiwiGenie | last post by:
I have an unbound form with text and combo boxes for entering search criteria . When Search button is clicked it builds a sql statement and assigns it to the recordsource of a subform. The subform...
15
by: cssExp | last post by:
hello, Rather than going on a wild explanation on what's the the problem, it'll be much quicker and easier if i let you look at it yourself, so I'll post my page source (actual contents taken out,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.