Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear a form's fields before entering data 1

Status
Not open for further replies.

thefourthwall

IS-IT--Management
Feb 26, 2002
387
US
Hello,

I have searched the forum and not found the answer I'm looking for; I may have missed it by using the wrong search terms, let me know.

The main form displays fields such as first/last names, employee id#, and cell phone info.

There are two combo boxes to search for either cell phone # or last name on the form.

When the form opens, and without any entry in either combo box, the fields displays the first record from the underlying query, and the users find that confusing.

I want to have fields such as name, cell number, etc., be blank until the user has entered a cell number or last name and clicked enter or tab. Thanks for the help.

 
If your main form was unbound, you would have this effect. You can nest subforms if need be.

This works when you use the combobox name as the master field for your master and child fields. The catch is that you have to type them in manually as opposed to building.

 
The form is bound to a query called "qryEmployeeDevice" but the two combo boxes are unbound.

Are you saying that its necessary to use a subform if I want the initial values for fields on the form to be blank?
 

When you open the form, send it to a new, blank record:

Code:
Private Sub Form_Load()
    DoCmd.GoToRecord , , acNewRec
End Sub

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
is this purely for searching/viewing numbers, names etc... or do you want the facility to add/delete entries as well?

I believe what lameid has said about subforms would be the ideal solution for you for searching.

It's not what you know. It's who's on Tek-Tip's
 
If you want a strict data entry form where you can only Add new records then set the form Data Entry property to YES. If you want to search and enter new records then yes the main form has to be unbound.
 
overdraft015,

The form is for searching/viewing cell numbers & their 'owners.' and occasionally changing parameters like the cell phone model. but never changing the owner name or cell #.

I do want to add the ability to delete cell #'s out of their table by a form; building a delete query today has so far been an exercise in frustration with no success.

themissinglinq, that's it! that did it perfectly, thank you..
 
Glad we could help!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
thefourthwall:

I have put a little mdb together for you to show how you can do searches for records using subforms. its a little tidier than getting all records.

there is also a record entry form using missinglinq's suggestion although i have used that for data entry.

when doing a search for a name/number if you plut a * at either end it will search for anything like that.

e.g. Name: Mi* will return everything starting Mi
Name: *ch* will return everything with ch in the name
Name: *ael will return everything ending in ael

same can be done with the number search too. hope this helps you with future access apps.

Regards,

Michael

It's not what you know. It's who's on Tek-Tip's
 
 http://www.arcintl.force9.co.uk/db/tek/Tel%20Dir.zip
How are ya thefourthwall . . .

As another option you can use the new record line to perform the dual function of search or adding a new record. In the AfterUpdate event of the fields of interest, you call code that performs the search. If the data is not found the user simply continues with data entry. Otherwise the add new line is cleared (via undo) and focus is set to the found data.

[blue]Your Thoughts?[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top