473,394 Members | 1,761 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,394 software developers and data experts.

Command Button to be enabled only when both listbox items are selected

Does anyone know how to start a form with a search button disabled, but when you choose a selection in listbox1 and listbox2 the button becomes enabled?
May 31 '07 #1
7 3024
Rabbit
12,516 Expert Mod 8TB
Does anyone know how to start a form with a search button disabled, but when you choose a selection in listbox1 and listbox2 the button becomes enabled?
In the after update of each listbox have it check for nulls, if both are not null then enable.
May 31 '07 #2
In the after update of each listbox have it check for nulls, if both are not null then enable.
what is the command for "not null' when referring to a listbox
Jun 1 '07 #3
You can use NOT "" if a null value implies the same as a zero-length string. "" indicates a ZLS in a text field.
Jun 1 '07 #4
You can use NOT "" if a null value implies the same as a zero-length string. "" indicates a ZLS in a text field.
I am sort of new to access so plz explain in beginner terms lol
Jun 1 '07 #5
Rabbit
12,516 Expert Mod 8TB
A zero length string is not the same thing as a null.

IsNull(String) returns true if the string is null. Not IsNull(String) returns true if the string is not null.
Jun 1 '07 #6
A zero length string is not the same thing as a null.

IsNull(String) returns true if the string is null. Not IsNull(String) returns true if the string is not null.
so the code would be:

If list1 and list2 Not IsNull(string) then
commandbutton.enabled=true ?
Jun 1 '07 #7
Rabbit
12,516 Expert Mod 8TB
so the code would be:

If list1 and list2 Not IsNull(string) then
commandbutton.enabled=true ?
No, it would be
Expand|Select|Wrap|Line Numbers
  1. If Not IsNull(Me.list1) And Not IsNull(Me.list2) Then
Jun 1 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mr. Bungle | last post by:
When importing excel from access I am fully aware that one can import directly into a table. Can you get as specific via code or something to import data from an excel sheet to a FORM (Not Table)...
2
by: Rebecca | last post by:
I have a dynamically created command button on a .net page that adds 1 row to a sql server table when clicked. The page_load event load rows from that table for the user to view, but for some reason...
1
by: Jason | last post by:
I was just wondering if there was any way to create a command button that when clicked will launch a cmd prompt and automatically paste the value of a field into the prompt? Thanks for you hellp...
4
by: yogitadesai | last post by:
Hi Group, How can I add a Command button inside a Listbox? I created a listbox and a command button on the form. now during the form_load event, I am trying to add command button to this listbox,...
3
by: afr0ninja | last post by:
Hello! I'm currently working on a form that has several input fields and a subform. What I'm trying to accomplish is that when I first open the form I'd like to have the input fields displayed...
3
by: Scldb | last post by:
I have a form that is linked up to the tables. I turned off the Navigation buttons. I put in a new command button that when clicked, it opens up a new record. What is the code that is needed for this...
4
by: abolos | last post by:
Hello, I have an unbounded text box which have a default value of Zero (0). And a command button which is not enabled and will save the value in the text box when pressed. What I want is that:...
0
by: mesadobes | last post by:
I am very new to visual basic. Actually, I have no clue what I'm doing! But I know what I want to do. I am trying to learn as I go... How do I create a command button that when clicked will...
1
by: Dennis | last post by:
I have a listbox that I fill with data from a stored proc. It's very basic - the proc returns two columns, one is used for the DataValueField of the listbox and the other is the DataTextField. The...
2
by: jmartmem | last post by:
I have an Access 2002 main form ("Project Update Form") with a subform ("sfEZMilestone"). What I want is to somehow change the subform to a command button so when a user clicks the command button,...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.