A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Keeping info in combobox



 
 
Thread Tools Display Modes
  #1  
Old June 6th, 2004, 09:46 PM
GregK
external usenet poster
 
Posts: n/a
Default Keeping info in combobox

I am re-doing a reservation system for a charity where peole can sponsor tables but thew location needs to know the names of all individuals attending. The current system has the user enter each reservation seperately for the table members. I need to be able to specify the host and a room for the table, then assign the names to the group. I am using a subform with a Combo Box in the header to select the room for the 1 to many individuals with the group. The Combo Box will put the correct value in the Room Code for the first record, when I move to the next record, the Combo Box is blank and the Room Code is not set. How do I keep the initial value that I set in the combobox for the second and subsequent entries?

I have tried the following code in the AfterUpdate event of the combo box:

Private Sub Combo17_AfterUpdate()
Me.Combo17.DefaultValue = Me.Combo17.Value
End Sub

It doesn't work for me. I need some help please. Thank you in advance.

  #2  
Old June 7th, 2004, 12:36 AM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default Keeping info in combobox

Regardless of the datatype, the DefaultValue property must be in quotes:

Me.Combo17.DefaultValue = """" & Me.Combo17.Value & """"

or

Me.Combo17.DefaultValue = Chr$(34) & Me.Combo17.Value & Chr$(34)



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"GregK" wrote in message
...
I am re-doing a reservation system for a charity where peole can sponsor

tables but thew location needs to know the names of all individuals
attending. The current system has the user enter each reservation
seperately for the table members. I need to be able to specify the host and
a room for the table, then assign the names to the group. I am using a
subform with a Combo Box in the header to select the room for the 1 to many
individuals with the group. The Combo Box will put the correct value in the
Room Code for the first record, when I move to the next record, the Combo
Box is blank and the Room Code is not set. How do I keep the initial value
that I set in the combobox for the second and subsequent entries?

I have tried the following code in the AfterUpdate event of the combo box:

Private Sub Combo17_AfterUpdate()
Me.Combo17.DefaultValue = Me.Combo17.Value
End Sub

It doesn't work for me. I need some help please. Thank you in advance.



  #3  
Old June 8th, 2004, 06:41 PM
GregK
external usenet poster
 
Posts: n/a
Default Keeping info in combobox

Thank you for the input. I have had to go a different route to handle some additional functionality. I appreciate the quick feedback.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.