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!

How to check if there is data in the table

Status
Not open for further replies.

Jar80

Technical User
Jun 13, 2004
69
FI
How can i check that Table Employees has a records?

First there will be opened mainmenu and it´s open event is where this code will be added, am i right?

No it works following way:
- Mainmenu is opened
- Mainmenu will be closed
- Employees form is opened
- Then check that there are any info in form
- if not then mainmenu button.enabled is false
- Else it´s true
- Mainmenu will be opened

This is very stupid way to do this because it´s too slow.
 
Hi Jar80,

Put this in the Form_Current event of your mainform:
Code:
Sub Form_Current()
 dim n as long
 n=Nz(DMax("RecID","Employees"),0)
 Me.EmployeeButton.Enabled=(n<>0)
End Sub

Replace RecID with some field name of your employees table (no memo field).

Hope this helps. ;-)

Cheers,
Andy

[blue]The last voice we will hear before the world explodes will be that of an expert saying:
"This is technically impossible!" - Sir Peter Ustinov[/blue]
HP:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top