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  

Combo Box



 
 
Thread Tools Display Modes
  #1  
Old June 3rd, 2004, 05:06 PM
external usenet poster
 
Posts: n/a
Default Combo Box

I use a combo box on a form that links information from a
related table. When I click on the arrow the drop down
box shows a list of values already populated in the
table. When I type in a value that isn't currently in the
related table, I get an message saying it is an invalid
value. Is there any way that I can make this box read in
a new value into the related or must I always choose from
the drop down list?
  #2  
Old June 3rd, 2004, 06:22 PM
Gerald Stanley
external usenet poster
 
Posts: n/a
Default Combo Box

You will need to place code into the combo's NotInList
eventhandler to populate the related table with the new
entry. Typically, the code in this eventhandler is along
the following lines

Private Sub combo(NewData As String, Response As Integer)
If MsgBox("Do You Wish to continue with new Value",
vbYesNo) = vbYes Then
code here to add entry to table or open up another
form
Response = acDataErrAdded
Else
combo.Undo
Response = acDataErrContinue
End If
End Sub

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I use a combo box on a form that links information from a
related table. When I click on the arrow the drop down
box shows a list of values already populated in the
table. When I type in a value that isn't currently in the
related table, I get an message saying it is an invalid
value. Is there any way that I can make this box read in
a new value into the related or must I always choose from
the drop down list?
.

  #3  
Old June 3rd, 2004, 07:04 PM
external usenet poster
 
Posts: n/a
Default Combo Box

Thanks for the response. I can't seem to use the additem
method to add the new entry. I used a query to populate
the combo box from the related table and I don't know if
that is what is not allowing me to complete the code. I
keep getting an error message when I try to run it.

-----Original Message-----
You will need to place code into the combo's NotInList
eventhandler to populate the related table with the new
entry. Typically, the code in this eventhandler is along
the following lines

Private Sub combo(NewData As String, Response As Integer)
If MsgBox("Do You Wish to continue with new Value",
vbYesNo) = vbYes Then
code here to add entry to table or open up

another
form
Response = acDataErrAdded
Else
combo.Undo
Response = acDataErrContinue
End If
End Sub

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I use a combo box on a form that links information from

a
related table. When I click on the arrow the drop down
box shows a list of values already populated in the
table. When I type in a value that isn't currently in

the
related table, I get an message saying it is an invalid
value. Is there any way that I can make this box read

in
a new value into the related or must I always choose

from
the drop down list?
.

.

  #4  
Old June 3rd, 2004, 10:57 PM
Gerald Stanley
external usenet poster
 
Posts: n/a
Default Combo Box

You do not need to code the addtion of the entry into the
list. Once the new entry has been added into the table
that is the rowsource for the combo, it should appear in
the list.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Thanks for the response. I can't seem to use the additem
method to add the new entry. I used a query to populate
the combo box from the related table and I don't know if
that is what is not allowing me to complete the code. I
keep getting an error message when I try to run it.

-----Original Message-----
You will need to place code into the combo's NotInList
eventhandler to populate the related table with the new
entry. Typically, the code in this eventhandler is along
the following lines

Private Sub combo(NewData As String, Response As Integer)
If MsgBox("Do You Wish to continue with new Value",
vbYesNo) = vbYes Then
code here to add entry to table or open up

another
form
Response = acDataErrAdded
Else
combo.Undo
Response = acDataErrContinue
End If
End Sub

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I use a combo box on a form that links information from

a
related table. When I click on the arrow the drop down
box shows a list of values already populated in the
table. When I type in a value that isn't currently in

the
related table, I get an message saying it is an invalid
value. Is there any way that I can make this box read

in
a new value into the related or must I always choose

from
the drop down list?
.

.

.

 




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 10:58 PM.


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