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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Objects disappearing off my form.

Status
Not open for further replies.

Radman

Programmer
Jan 20, 2000
22
AU
Hi there helper,
I have created a login form using a query that is built during run time. When the query is run and if it does not find a record in the database, all my objects (i.e edit boxes, labels, buttons) disappear from the form.

When the query does find a record in the database that matches, the objects don't disappear. I have tired forcing the objects to visible, but that does not work. The only way fot the objects to reappear is for me to close the form and reopen it. Does anyone have any suggestions.....

Thanks Radman

[sig][/sig]
 
I assume you are using Access 2000. The default behavior when no record is found is to have a blank form. You can capture if no record is found in different ways. Here is one way in your Open Event for the form.

If (Form.Recordset.EOF And Form.Recordset.BOF) Then
MsgBox ("Hi amigo")
Form.Recordset.Close
" you could reopen the form here " or " whatever you deem appropriate"
End If
[sig][/sig]
 
Hi,
I am using Access 97....is there any other way that you know of????????

Thanks [sig][/sig]
 
If this form is being used for Log-in you probably dont need to have a bound form. By using an unbound form and setting the record source after doing the query your form will appear the same both ways.
[sig]<p>John A. Gilman<br><a href=mailto:gms@uslink.net>gms@uslink.net</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top