Help with Function “Count” in a Form

diakis

Registered User.
Local time
Today, 23:38
Joined
Jul 4, 2006
Messages
16
Hi,
in db of Access 2003 I have a Form “fr_lath” with a TxtBox “kim1333”.
The control source of this TxtBox is “=Count([cοd_ame])”.
[cod_ame] is a field in this Form.
This way I have in “kim1333” the number of records in this Form.
In another Form “fr_dask” there is a CmdBox “ent13” clicking on which you go to this code:

Private Sub ent13_Click()
‘1. Close form “fr_dask”
DoCmd.Close ‘close form “fr_dask” ‘It works

‘2. Open form (“fr_lath”)
DoCmd.OpenForm (“fr_lath”) ‘It works

‘3. Under this line it doesn’t work
If Me.Form.Control(“kim1333”)>0 Then MsgBox “Try again”
‘That means there are records in Form “fr_lath” and with a click on “O.K.” of MsgBox I stay in Form “fr_lath” that is open.
If Me.Form.Control(“kim1333”)=0 Then DoCmd.RunMacro "m"
‘That means there are no records in Form “fr_lath” and I want after this to auto run a macro named "m"
End Sub

Could anybody help to write the correct code under line 3?
Note: “kim1333” takes values like 1,2,3…, but instead of 0 there is “”
Thanks a lot!
 
try...
Code:
If Me.kim1333 > 0 Then MsgBox “Try again”
 
lagbolt, unfortunately it does not work
 
I recommend that you describe the nature of the failure in greater detail.
 

Users who are viewing this thread

Back
Top Bottom