Make data from a pull down list mandatory

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2005
Posts: 23
Reputation: dreyes67 is an unknown quantity at this point 
Solved Threads: 0
dreyes67 dreyes67 is offline Offline
Newbie Poster

Make data from a pull down list mandatory

 
0
  #1
Feb 1st, 2005
In my form I have a pull down that will display the names of all the clients. The users select a name, and it is entered in the field. But, then I have a few lazy Uses that will enter any thing to save time on their part. This is the Code I use for the field

'Retrieve Category info from table
Set rst1 = db.OpenRecordset("Work4number")
Set ctl = Item.GetInspector.ModifiedFormPages("Message").Controls("cboClient")
ctl.ColumnCount = 2
ctl.ColumnWidths = "40; 20 pt"

'Assign Access data to an array of 2 columns and 500 rows
CategoryArray(99, 2) = rst1.GetRows(500)
ctl.Column() = CategoryArray(99, 2)
'-=-=-=-=-=-=-

How can I make it so that they can only enter from the selected list and not type in a Client, even if the client name is correct?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Make data from a pull down list mandatory

 
0
  #2
Feb 1st, 2005
In The Combo (or drop down) menu's keypress event, you trap the user typing. For example, you could, change keyascii to be the backspace character, or set the .text property to "". You could, display a message box that tells the user that keyboard input is a restricted function. The options are really endless.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 200
Reputation: mnemtsas is an unknown quantity at this point 
Solved Threads: 1
mnemtsas's Avatar
mnemtsas mnemtsas is offline Offline
Junior Poster

Re: Make data from a pull down list mandatory

 
0
  #3
Feb 3rd, 2005
Is this an access form? If its a regular VB form then set the style of the dropdown to Dropdown List. If its an access form I have no idea
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Make data from a pull down list mandatory

 
0
  #4
Feb 3rd, 2005
I believe there is a way in access, I just don't quite remember what it is. Setting the style (in vb) of the combobox to dropdown works too, I just like to warn users when they do something silly
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 23
Reputation: dreyes67 is an unknown quantity at this point 
Solved Threads: 0
dreyes67 dreyes67 is offline Offline
Newbie Poster

Re: Make data from a pull down list mandatory

 
0
  #5
Feb 3rd, 2005
This is MS Outlook form and I found the solution. I need to right-click on the field and go into Advance Properties. Select the Style and go from the default option 1 to the second option.

Thank you
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Make data from a pull down list mandatory

 
0
  #6
Feb 3rd, 2005
Truth Is, I didn't know that ms outlook had forms
More less The ability to figit with them. Something I'll have to look up.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 23
Reputation: dreyes67 is an unknown quantity at this point 
Solved Threads: 0
dreyes67 dreyes67 is offline Offline
Newbie Poster

Re: Make data from a pull down list mandatory

 
0
  #7
Feb 3rd, 2005
Lets see if I can either attach a picture of the MS Outlook form. This form is filled out by a inhouse User that is requesting Opertionas to convert a file sent by a Client from their format (software) to the formats that we us on our Mainframe.
Attached Thumbnails
pc conversion pic.jpg  
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 4
Reputation: visuallearner is an unknown quantity at this point 
Solved Threads: 0
visuallearner visuallearner is offline Offline
Newbie Poster

Re: Make data from a pull down list mandatory

 
0
  #8
Jan 22nd, 2009
I am trying to make a 'Supervisor' field in an excel spreadsheet mandatory. They need to complete this field, then click on a "submit" button at the bottom of a different page in the spreadsheet. However, if the 'Supervisor' field is left blank, then a message box pop up that states," Supervisor name required for Submission." I am new to visual basic and have looked at tutorials but cannot figure out how to make this field mandatory so that the message box pops up. Any help would be appreciated. Thanks!
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Make data from a pull down list mandatory

 
0
  #9
Jan 22nd, 2009
How about making your own thread instead of posting on one that is 4 years old?
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 4
Reputation: visuallearner is an unknown quantity at this point 
Solved Threads: 0
visuallearner visuallearner is offline Offline
Newbie Poster

Re: Make data from a pull down list mandatory

 
0
  #10
Jan 22nd, 2009
Originally Posted by Comatose View Post
How about making your own thread instead of posting on one that is 4 years old?
Sorry- I didn't mean to. I created my own thread for this. Thanks.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC