Prevent combo box value change

H

HilcrRWise

I have a form with a combo box used to list names. What I want t
happen is that initially a person selects a name from the combo bo
enters relevant details in other fields on the form, but when they mov
on to a new record the combo box doesn't change so still shows the nam
selected in the last record. I want this to continue until a record i
selected that has already been created and that has a different nam
entered, in which case the combo box will show that name, and wil
continue displaying this name for new records until again another nam
has already been entered, and so on.

I already have the combo box setup so the value selected is entered i
to a table, but whenever a new record is created the combo box i
blanked off.

Is this possible?

I am a newbee when it comes to VB coding so if this is required pleas
try to explain what each step does.

Thank
 
P

prabha

Hi,

Using VBA code you could do something like the following:

Option Compare Database
Public strValue As String

Private Sub Combo10_AfterUpdate()
strValue = Comb10
End Sub


- Then set the Control Source of a textbox control on the Form (make it not
visible) =[strValue]
- Then make the DefaultValue of your ComboBox equal to your textbox control

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."


--------------------
| From: HilcrRWise <[email protected]>
| Subject: Prevent combo box value change
| Date: Fri, 30 Jan 2004 06:31:28 -0600
| Message-ID: <[email protected]>
| Organization: MSAccessForum.com
| User-Agent: MSAccessForum.com
| X-Newsreader: MSAccessForum.com
| X-Originating-IP: 212.132.0.12
| Newsgroups: microsoft.public.access.forms
| NNTP-Posting-Host: 69-56-172-122.theplanet.com 69.56.172.122
| Lines: 1
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA0
5.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.access.forms:253105
| X-Tomcat-NG: microsoft.public.access.forms
|
|
I have a form with a combo box used to list names. What I want to
happen is that initially a person selects a name from the combo box
enters relevant details in other fields on the form, but when they move
on to a new record the combo box doesn't change so still shows the name
selected in the last record. I want this to continue until a record is
selected that has already been created and that has a different name
entered, in which case the combo box will show that name, and will
continue displaying this name for new records until again another name
has already been entered, and so on.
|
| I already have the combo box setup so the value selected is entered in
to a table, but whenever a new record is created the combo box is
blanked off.
|
| Is this possible?
|
| I am a newbee when it comes to VB coding so if this is required please
try to explain what each step does.
|
| Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top