473,325 Members | 2,308 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,325 software developers and data experts.

If my listboxes contain no entries, then my command button should stay disabled

If both of my listboxes are not selected, my command button needs to stay disabled. Whats the code for this? I tried everything, im pulling my hair out lol
May 14 '07 #1
6 1835
If both of my listboxes are not selected, my command button needs to stay disabled. Whats the code for this? I tried everything, im pulling my hair out lol
anyone? :(
May 14 '07 #2
anyone? :(
let me rephrase the topic. if my listboxes are not selected then my command button should stay on disabled. when both selections are made (1 from each listbox) then the command button can be enabled. anyone know how to come across this?
May 14 '07 #3
ADezii
8,834 Expert 8TB
let me rephrase the topic. if my listboxes are not selected then my command button should stay on disabled. when both selections are made (1 from each listbox) then the command button can be enabled. anyone know how to come across this?
Expand|Select|Wrap|Line Numbers
  1. If IsNull(Me![lstOne]) And IsNull(Me![lstTwo]) Then
  2.   Me![cmdTestButton].Enabled = False
  3. Else
  4.   Me![cmdTestButton].Enabled = True
  5. End If
May 17 '07 #4
Expand|Select|Wrap|Line Numbers
  1. If IsNull(Me![lstOne]) And IsNull(Me![lstTwo]) Then
  2.   Me![cmdTestButton].Enabled = False
  3. Else
  4.   Me![cmdTestButton].Enabled = True
  5. End If
this doesnt work. where should i put this? form load??
May 18 '07 #5
ADezii
8,834 Expert 8TB
this doesnt work. where should i put this? form load??
  1. If you are doing this for each Record, place the code in the Form's Current() Event.
  2. Substitute your Control Names for lstOne, lstTwo, and cmdTestButton.
May 18 '07 #6
missinglinq
3,532 Expert 2GB
when both selections are made (1 from each listbox) then the command button can be enabled
This sounds like the OP wants the button enabled only if a selection has been made from each listbox, which is to say if either Or both listboxes are unselected the button should not be enabled

Expand|Select|Wrap|Line Numbers
  1. If IsNull(Me![lstOne]) Or  IsNull(Me![lstTwo]) Then
  2.   Me![cmdTestButton].Enabled = False
  3. Else
  4.   Me![cmdTestButton].Enabled = True
  5. End If
Jun 13 '07 #7

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

Similar topics

2
by: Colin | last post by:
I have a main form with a command button on it that when clicked, opens a subform displaying records that relate to the main form. I would like to disable the command button if the corresponding...
2
by: Vinayak Shanbhag via AccessMonster.com | last post by:
Hi, I have the following problem ------------------------------------ I am displaying the multiple records in MS Access Detail Section. Each row has Command Button called "Store". I need to...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
2
by: emc_cos | last post by:
I have a very nice parent child relationship happening between a main form and 8 subforms. The main form is the data entry point for a table that holds textual data like names, notes and the...
0
by: Keithb | last post by:
My application has a LinkButton that I am using as a Command button in the ItemTemplate of a GridView control. Regardless of the value set for the Enabled property (true or false), The control is...
8
by: rahulnag22 | last post by:
I have created a button widget with a button click binding. The button initially has a state=disabled. I can see the greyed out version of the button in the GUI. But If I click on the button it...
24
Dököll
by: Dököll | last post by:
Jumped for joy last night after learning, indeed, the command button wizard can be switched on or off. Well this occured here, with my Access 2000...an attempt to redo at work failed. Here's the...
8
by: ARC | last post by:
Hmmm...This is interesting. While reading info on packaging an Access 2007 runtime app, it's mentioned that a file such as, .accde (mde for 2007) will be changed to .accdr, where the final r means...
4
by: Hiramicus | last post by:
Hi - I'm using Access 2003. I have an input form that I'm trying to link to multiple tables. I have a command button that updates all the tables with the ~40 textboxes which the user inputs the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.