| | |
Make data from a pull down list mandatory
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2005
Posts: 23
Reputation:
Solved Threads: 0
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?
'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?
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.
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
Mark Nemtsas
Time and Billing Software - Time Tracking Software - Roller Shutters - Roller Blinds -
Baby Books
Time and Billing Software - Time Tracking Software - Roller Shutters - Roller Blinds -
Baby Books
•
•
Join Date: Jan 2009
Posts: 4
Reputation:
Solved Threads: 0
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!
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Connectin VB6 to mssql and select option button
- Next Thread: Listing number of Occurrences in Excel
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






