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

default a combo box based on a message box

158 100+
I have a combo box with 6 different options (opt1 ,opt2, opt3 etc). When the form first loads it asks a question and gives them a choice of answers (ans1, ans2) If they choose ans1 i want the drop down box to default to opt6, if they choose ans2 i want it to load normally. I thought i could just do this in the load section
Expand|Select|Wrap|Line Numbers
  1. if (ans1 = true) then
  2. cbo1 = opt6
  3. end if
  4.  
thanks for any help
Jun 13 '08 #1
4 1365
ADezii
8,834 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. If (ans1 = True) Then
  2.   Me![cbo1] = "opt6"
  3. Else
  4.   Me![cbo1] = ""
  5. End If
Jun 13 '08 #2
NeoPa
32,556 Expert Mod 16PB
Well, you're pretty well there as far as I can see anyway (other than the quotes of course) :
Expand|Select|Wrap|Line Numbers
  1. If ans1 = True then Me.cbo1 = "opt6"
You don't really want an ELSE clause.
Jun 16 '08 #3
Jollywg
158 100+
Thanks for the replies...once i saw how to do it a big DUH! sign got slapped across my forehead.

Thanks a lot!
Jun 16 '08 #4
NeoPa
32,556 Expert Mod 16PB
Hey, we've all been there you know :D
Jun 17 '08 #5

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

Similar topics

5
by: Harry Haller | last post by:
<select name="cboPlaces" id="cboPlaces"> <option value="3">Countryside</option> <option value="4">Forest</option> <option value="5">Mountain</option> <option value="6">Desert</option> <option...
2
by: Rob | last post by:
Hello, I am developing an A2K application.In the subform ,I have around 4 combo boxes for Group,Division,Name and Application.The selection criteria of each combo is narrowed based on the value of...
2
by: David Mitchell | last post by:
I have a multiuser database which VBA to return the current users NT logon. The database has a table which contains the names of all users and a field called bmlogon which holds their NT logon. ...
2
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I've created a bound form to a table. I've added two lookup combo boxes so the user has a choice of how to look up a record (Individuals or Organizations). The...
3
by: dmkeith2 | last post by:
I have a table for all my combox boxes. ID: AutoNumber ComboName: text ComboValue: text with no duplicates I have create a query based on this table. I have also created two forms based on...
4
by: tlyczko | last post by:
I read about limiting combo boxes' list data, for example, limiting the list of values in the second combo based on values in the first combo, and I found the Dev Ashish site link. I have two...
0
by: northshore | last post by:
Hello, I am creating a windows application database. I have a primary table 'Individuals' and a lookup table 'Prefixes.' In the Individuals table, I have a column 'PrefixID' that references...
4
by: Torilyn73 | last post by:
I have a combo box set up off a query. I want the default value to be the column heading so I don't have to put a label over it. So far I haven't been able to figure this out. Can anyone tell me if...
2
by: Brad Pears | last post by:
In my vb.net 2005 project I have a few combo boxes where I want to set a default value. I am not binding these combo boxes - I am loading the values directly in code from a dataset. Obviously...
2
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
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:
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.