Force combo box selection before moving off field

I've searched through the group but I can't seem to find exactly what I'm 
looking for.

Using 2000 ...

I have a combo box on a form.  The row source is a simple query.  The 
control source is a long integer (link to an autonumber).  Form is based on a 
table.

I don't want the user to be able to move off the CB (combo box) unless they 
select something from the list (or type in a new item).

I've tried making the control source required in the table.  This won't let 
them move off the RECORD until they do something in the CB.  I want them 
stopped at the CB.

I set up code to check the value of the control source (on exit) and if it's 
0 display a msg box.  Works great  - but now I want to put them back at the 
CB and I can't figure out how.

I can't use the setfocus option because it still moves off the CB.

Can't use the before or after update because if they just tab past the CB 
there's no change and those events don't get triggered.

I think this should be simple and it's driving me nuts.  Help!!

Lauri S.
0
Utf
1/4/2008 5:43:00 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
1282 Views

Similar Articles

[PageSpeed] 37

The OnExit event *is* triggered by tabbing and can be cancelled to hold the
focus in the control.

LauriS wrote:
>I've searched through the group but I can't seem to find exactly what I'm 
>looking for.
>
>Using 2000 ...
>
>I have a combo box on a form.  The row source is a simple query.  The 
>control source is a long integer (link to an autonumber).  Form is based on a 
>table.
>
>I don't want the user to be able to move off the CB (combo box) unless they 
>select something from the list (or type in a new item).
>
>I've tried making the control source required in the table.  This won't let 
>them move off the RECORD until they do something in the CB.  I want them 
>stopped at the CB.
>
>I set up code to check the value of the control source (on exit) and if it's 
>0 display a msg box.  Works great  - but now I want to put them back at the 
>CB and I can't figure out how.
>
>I can't use the setfocus option because it still moves off the CB.
>
>Can't use the before or after update because if they just tab past the CB 
>there's no change and those events don't get triggered.
>
>I think this should be simple and it's driving me nuts.  Help!!
>
>Lauri S.

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200801/1

0
ruralguy
1/4/2008 6:23:35 PM
the cancelevent mentioned is probably the more proper way.

The other thing that I have done in some cases do a setfocus to some
other button or control and THEN do the setfocus back to the control I
want it to be on.

Ron
0
Ron2006
1/4/2008 7:41:02 PM
Reply:

Similar Artilces:

Force Uninstall
All, A coupla questions . . . Suppose I just want to forcefully uninstall Exchange 2000 from a server, and an org. Currently the uninstall fails because (as mentioned in a previous post) I have users that still show as being on that server, however the store that those users were on is no longer there (because of a disaster). Is there some way to force the uninstall? Another question. I have two healthy clustered machines running currently. Suppose I just remove the object for the old exchange server from the ESM? Assuming I have performed all of the other steps steps (like moving o...

Help, NDR's are flooding my boss's email box!
Outlook 2003 / Exchange 2003 sp2 One user (my boss!) is getting inundated with System Administrator NDR's. I know that these are coming back as a result of a spoofed email address. 300 + a day! We have anti spam and anti virus in our enterprise so I know they are propigating from outside. Anyway, Outlook 2003 will not allow a rule to be created to move all of these Sys Admin messages out of her Inbox, and I don't want to disable the NDRs all together. How can I keep the benefits of NDR's and yet allow my user to have a "clean" mailbox. I'm out of ideas thanks ...

Unbound Combo Refresh
I have an unbound combo on a form that is summing a value from a subform. (=sum([project payments]) I need it to update as I change from one record to the next in the main form. The mainform and subform are linked by project #. Thanks!!! -- Milton Purdy ACCESS State of Arkansas me.unboundcombo.requery in the form current event would be my initial thought... -- Maurice Ausum "golfinray" wrote: > I have an unbound combo on a form that is summing a value from a subform. > (=sum([project payments]) I need it to update as I change from one record to &g...

Who does text move?
Hi, Does anyone know why text made with publisher moves when a website is loaded? Oscar If you are referring to your website try checking your Publisher file with, from the Tools menu, Design checker. You may have some text boxes on top of one another. -- Don Vancouver, USA <jeroen.van.bijsterveld@davilex.nl> wrote in message news:1187614503.599939.227360@g4g2000hsf.googlegroups.com... > Hi, > > Does anyone know why text made with publisher moves when a website is > loaded? > > Oscar > ...

forcing user input into cells
howdy all... i'm new to doing stuff with excel have a bit of a background in javascript programming what i'm trying to do is force a user to enter something, anything int a specific cell if the user tries to tab past the cell and leave it blank, i want a error to come up, telling them that they have to enter something befor they can continue on with entry into other cells any help would be much appreciated -Thank -- georgi ----------------------------------------------------------------------- georgio's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=164...

List box, Combo box
Is it possible to select an existing item in a drop down menu, such as list or combo box, and have it link to another sheet tab, for exampl sheet2 or sheet -- P-C-Surgeo ----------------------------------------------------------------------- P-C-Surgeon's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1477 View this thread: http://www.excelforum.com/showthread.php?threadid=26396 yes, it is possible. it involves writing a macro for that combobox o listbox -- icestationzbr ----------------------------------------------------------------------- icestationzbra&#...

Message Box
Hiya, I was wondering if the following is possible with Excel 2000 I would like to see an comments/message box appearing when an Excel sheet is being opened. Basicly I want that when someone opens an (log file) excel sheet a messages appears saying please update this or that before they can go on with the sheet it self, it is like a reminder. Kind regards, Mr.WJCA Place MsgBox "messagetext" in Workbook_Open() event sub! Post if you need help to instaal it! Regards, Stefi „MR.WJCA” ezt írta: > Hiya, > > I was wondering if the following is possible with Exce...

Force quit
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Closing Word get error message &quot;A file error has occurred. Check your network connections or make sure the disk is properly inserted&quot; Am then required to use force quit. Anybody have solution? Make sure Office & OS X are fully updated. If they are & you still encounter the problem, crashing on Quit is usually the result of one of theses causes: Need to repair disk permissions Damaged preference files Corrupt Normal.dotm template See this page for the respective links in t...

Combo Box Text Alignment
Is it possible to tweek the text alignment in a combo box other then the standard "Left-Right-Center" preset options ? Thanks - George What specifically are you looking for? Assuming you use a query as the RowSource, you've always got the option of concatenating spaces in front (or after) a field. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "George" <George@discussions.microsoft.com> wrote in message news:E1366215-05A0-45BB-A27B-272A47458FC8@microsoft.com... > Is it possible to tweek the text alignment in a ...

select a specific ActiveCell by VBA
In any cell in column "F", a user can select a code number from a drop down list. These numbers go up to over 100, so, if the user isn't sure of which number to select, cell F6 can be rightclicked and VBA will take the user to a different sheet where all the code numbers (and their associated meanings) are listed. A command button on that sheet will take the user back to the ActiveCell on the first sheet. Even if the user was working in cell F2000, the active cell is now always F6 To get around this, how can I set the active row to the bottom most row with data i...

Jscript to hide fields #2
Hi We have created two custom entities named suppliers and business partners. We would prefer not to create account records and use the relationship type field so we created these custom entities. We now have on the Contact form three seperate fields that a contact could be related to. These fields are parent customer, parent supplier and parent business partner. A Contact should only be associated with one parent record. We would like to write Jscript which hides the remaining fields if one of the fields is populated. If a user associates a Contact with a parent customer then the pa...

Forcing Appointments
I use outlook to schedule appointments with my customers with specific employees. I have a scheduling department that does this scheduling via outlook. The employees have no option to reject or modify these appointments; therefore, I would like to force this on their calendar with them having to accept it and not allowing them to modify it. Additionally, I need to know real time once they are scheduled. Right now I don't know they are scheduled until they accept and that sometimes takes too long and then they are inadvertently double booked by the scheduling department. So how do ...

Row Source in combo box
The records in my database are made up of different hospitals. I have a form that contains all the data needed for each hospital. A switchboard lets the user select different groups of hospital - a macro then loads the form with a different query. This works fine. There is a combo box on the form which is used to navigate to a chosen hospital. The problem I have is that it always contains every hospital in the database rather than just the ones in the query the macro has run. I suspect the property I need to change on the combo box is Row Source which currently is static : it is cu...

2008 server unable to ping sbs 2003 box
All, Recently purchased a new 2008 server. I added this new server to our SBS 2003 environment. I was able to JOIN the sbs domain. My problem now is that I can not ping the sbs box or any other TS server on the network. I assigned the new server the following IP information: IP address: 192.168.1.11 Mask: 255.255.255.0 Gateway: 192.168.1.1 DNS 192.168.1.2 (this is the SBS box) Our SBS box is using one NIC card. We have a router that is handling our firewall. Thank you, Th...

Can't move mailbox
My question is similar to "Can't Purge Mailbox". I have one mailbox left to move in a migration from exchange 2000 to 2003, and it will not move. I can move it between 2000 stores and servers but not to exchange 2003. I recieve the following error when I try to move it: - <summary isWarning="false" errorCode="0xc1054005"> The MAPI call failed. MAPI or an unspecified service provider. ID no: 80004005-0000-00000000 There are no corrupted messages, I have checked each one. The mailbox size is under 200mb. This is the only mailbox left to move??? I ...

Field with both first name and last name
I have a table where the field PRODUCTION_DESIGNER is composed of a persons first and last name with a single space between them, for example "David Henderson" is in the contents. Select this field and truncate this to the initials of the first and last name and place into another field leaving the original field untouched. The new field would have "DH" as its contents. Thank you Use the expression Left(Production_Designer,1) & Mid(Production_Designer,Instr(Production_Designer," ")+1,1) If you want to do this in an update query UPDATE [Your Table ...

Force REPLY to go back to distribution list
I have an issue whereby a department is insisting that they want their mailing lists marked so that any time anyone clicks REPLY (not "REPLY ALL" - they refuse that as an acceptable solution, it must be REPLY) that the reply message goes back to the distribution list and not the message originator. They further insist that this capability must occur on the mail server (and not on Outlookclient side), since they use a multitude of different mail clients (many on Unix/Linux) and therefore it is a server-side responsibility to make this happen. They say that this capability exists in ...

Import Export--Map Custom Fields
Using OL2003 I tried to import some calendar entries from a tab-delimited .txt files. The import worked just fine. Then, I realized that I needed to add additional info to the .txt file so I deleted all my new calendar entries and went back and edited the file. This time when I get to the Map Custom Fields window, I AM able to map all the data to the correct fields but the "OK" button is now greyed out. Nothing I can do seems to bring the "OK" button back. I made a completely new .txt file in case something had become corrupted in the original one. I ran Detect an...

Expand Combo box
I have a ComboBox (cboClient) that searches the form for a specific record. I would like for the combo to expand when the user begins to type so that they can see where they are in the list. As it is right now, the user must begin typing and then click the arrow to expand the box. Any help is appreciated! Tara Tara wrote: >I have a ComboBox (cboClient) that searches the form for a specific record. >I would like for the combo to expand when the user begins to type so that >they can see where they are in the list. As it is right now, the user must >begin typing and the...

Error after mailbox move E2K
Hi! Yesterday I moved a mailbox from one E2K server to the other one. Event log at server 1 told me that it was finished sucessfully. It disappeared from the Exchange System Manager view at server 1.Server 2 shows a red cross in front of the mailbox. In the context menu I am offered to reconnect the mailbox. But after choosing this I'm told that it is already connected to a user, that replication is not finished. But this ongoing for too many hours. Server 1 shows event 1205 in the event log (mailbox of this user cannot be created due to error 0x50x). I also cannot move the mailbox back o...

comment box pop ups
dear kind people who know excel! I have a sheet where in column A I have the name of a compnay. In column D (which is hidden) I have some descriptive info. Is it possible for the info in column D to come up in a comment box (or any otehr pop up box) when I hover over a cell in column A? The sheet is being continually sorted so it needs to be quite robust. thanks in advance Rather excel illiterate person! The only thing that I know that shows up when you hover the mouse over the cell is a comment. So if you added the text in column D to the comment in column A, then it might work? ...

Contact selection problem in CRM 4 Mail Merge
I can use mail merge option for all contacts on page (grid) without any problems, but if I select one contact or a small selection of contacts the merge resulting list has one entry but only data from the user entity, not from the contact entity...I have no contacts to merge. Merge also fails if I select a merge from an open contact form. I have selected contact attributes in the template. I have administrative rights. Any ideas? ...

filename and path of linked ole file in blob field
hello, I have an application with frontend Access 2000 and SQL Server 2000 als backend. One table contains a blob field that is filled with linked ole objects. As I believe the filename and path of the file are stored in the blob field instead of data . Now, I need to push all these files from filesystem into a new blob field with file data embedded. Does anyone know a way how to move the files (paths must be in blob, but I cannot access them) into a new blob programmatically ? Best regards Guenther Guenther have a look here: http://www.lebans.com/oletodisk.htm NEW - Feb 06/2006...

Combo Box to update fields in a form
I have a form which is used to enter client data into a table. I wish to use a combo box to search for a clients name and then show the clients record (address etc) into the other fields on the form from the original table the info was entered into. I have tried queries to no avail and have no knowledge of code, so answers in words of one syllable please Thanks "richard" <richard@discussions.microsoft.com> wrote in message news:11D07930-3D55-490A-AD94-29E9E2709A68@microsoft.com... >I have a form which is used to enter client data into a table. I wish to >use > ...

select worksheet
There is probably a very easy answer to this question, but if you don't know you ask. I want a specific worksheet to open when I open the workbook. Is there specific code that needs to be written or can I do it in the worksheet properties? The help files seem to be vague on this issue. Thank you for any help. ...