Form check for NZ (1 Viewer)

Sweetu

Registered User.
Local time
Today, 06:23
Joined
Sep 13, 2016
Messages
21
Dears Experts,

I'm in need of your expert assistance,
If we created a form based on table but we need to check for empty or null cell/feild values that we left intentionally while filling out the data...
But after some time we need to update that feild from Form....

I know We'll check for, NZ or If isnull() then enable the property True or False...
But how we'll apply to a on click button to open form then check out for null and True the feild if it's not null or False the Enabled property if feild feild is null.... If all feilds are not null then msg....

Please advice me.... Thanks to all great community here
 

Ranman256

Well-known member
Local time
Yesterday, 23:23
Joined
Apr 9, 2015
Messages
4,337
If need to check the fields, then set up a Validate() check before you leave the form.
Set all fields to NZ, in a query, which doesn't need a validate, but it just closes loophole.
For the fields that CANNOT be null, this where the validate() check stops everything.

If isNull(field1) then MsgBox "field1 cannot be null.
If isNull(field2) then MsgBox "field2 cannot be null.
 

Sweetu

Registered User.
Local time
Today, 06:23
Joined
Sep 13, 2016
Messages
21
If need to check the fields, then set up a Validate() check before you leave the form.
Set all fields to NZ, in a query, which doesn't need a validate, but it just closes loophole.
For the fields that CANNOT be null, this where the validate() check stops everything.

If isNull(field1) then MsgBox "field1 cannot be null.
If isNull(field2) then MsgBox "field2 cannot be null.

No dear I'm asking about checking for null field or NZ in form and then in textbox property sheet, Data tab and Enabled" Yes/No"...
How to enable that in VBA....
Maybe we need to write VBA on load form but how set property sheet>Data Tab>enabled to Yes or No by checking textbox is null with VBA....
 

Attachments

  • tmp_29350-_20160922_0833212043737458.jpg
    tmp_29350-_20160922_0833212043737458.jpg
    98.5 KB · Views: 61

Ranman256

Well-known member
Local time
Yesterday, 23:23
Joined
Apr 9, 2015
Messages
4,337
You dont enable fields in a data sheet, you use a form.

You don't need to NZ a textbox because its connected to a field, so you can just NZ the field using a query.

But if you want to enable a textbox, then textBox.locked = false,
Or textBox.enabled = false.
 

Sweetu

Registered User.
Local time
Today, 06:23
Joined
Sep 13, 2016
Messages
21
You dont enable fields in a data sheet, you use a form.

You don't need to NZ a textbox because its connected to a field, so you can just NZ the field using a query.

But if you want to enable a textbox, then textbox.locked = false,
Or textBox.enabled = false.

I'm using on load Form ,Still no success
------------------------------
If Is Null(me.textbox.value) then
textbox.enabled=False
Else
textbox.enabled=True
------------------------------
but actually this should be on click button where I'll find in the form textbox for one field called ID to enable or disable the textboxs if null or not....
(Check in attached Test form, tbl2 if i search in test form search & on click update i get the same form & those fields are already filled must be disable and empty field should be available to enter data.....
 

Attachments

  • Database.accdb.zip
    446 bytes · Views: 64
Last edited:

Users who are viewing this thread

Top Bottom