473,395 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

disable button if field is empty

hello,

This sounds simple but I can't seem to manage...

So I'm in a form, and have got a button to "open" (make visible) a
subform.
the subform actually contains fields from the same table as the big
form.
but I want the open button to be disabled if a field in the subform is
empty.
But I only seem to be able to disable the button on form_load or other
events.
but how do I check this when I use a search, or when I go to the next
record with the arrows?
cause when I use the arrows, it is no longer a form_load, so if the
button was disabled because the field was empty in the first record,
then how do i "recheck" when I go to another record?.

first I was thinking like:

If IsNull (subform!thefield) Then button.enabled = false Else
button.enabled = true End If

but even here I keep getting an error telling me: object required.
he even doesn't accept the end if sometimes.

I don't seem to find it,
hope you understand ...
thanks in advance,
Olivier

Oct 12 '06 #1
1 14429
Hi Oliver,

<ol*************@gmail.comschrieb
first I was thinking like:

If IsNull (subform!thefield) Then button.enabled = false Else
button.enabled = true End If
good thinking.

Put the code into your subform under the "Sub Form_Current()".

Code should be something like that:

If IsNull (subform!thefield) Then
form!thebutton.visible = false
Else
form!thebutton.visible = true
End If

You surely may use "enabled" instead of "visible".

Regards

Michael
Oct 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
2
by: techfuzz | last post by:
I scoured this group and others looking for the best way to disable a button after the first click to prevent multiple submissions, but never did find anything that worked like they said it would. ...
14
by: Sinity | last post by:
Anyone knows the method/codes to disable the clicked button after first click by using .aspx-- to prevent people to click many time when waiting for the server response. I tried to do this by...
3
by: Jeff | last post by:
I have a payment form with a submit button. A large percentage of users double-click the submit button thus submitting their payment information twice. I would like to use javascript to disable...
2
by: bkunjitam | last post by:
Hi, I am using Python 2.5. I have an entry field and a radio button. I need to disable the entry field when the radio button is selected. How do i change the state to DISABLED in run time. ...
3
by: pushrodengine via AccessMonster.com | last post by:
Within the form “frmIncidentForm” I have a textbox and a command button. I would like to disable the “AddIncident” button when the “IncidentID” textbox is NOT empty. If possible I...
4
by: =?Utf-8?B?TUNN?= | last post by:
I am trying to disable ViewState at the application level. I have the following line in my web.config: <pages enableViewState="false"></pages> But it is not working. What can I do?
5
by: andersond | last post by:
I need to enable or disable a submit button based on the value of a data field stored in a database. I have found working examples of how to enable or disable based on a checkbox; but, I need it to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.