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  

inputbox for a combobox (easy)



 
 
Thread Tools Display Modes
  #1  
Old May 17th, 2005, 06:41 PM
dogpigfish
external usenet poster
 
Posts: n/a
Default inputbox for a combobox (easy)

Any way to set up an inputbox prompt to fill in a combobox. I want an
inputbox to ask for a name. When I input the name I want the combobox to
show that name.
  #2  
Old May 17th, 2005, 08:36 PM
Jeff Conrad
external usenet poster
 
Posts: n/a
Default

"dogpigfish" wrote in message:
...

Any way to set up an inputbox prompt to fill in a combobox. I want an
inputbox to ask for a name. When I input the name I want the combobox to
show that name.


Something like so??
(I put this on a command button click event)

Private Sub cmdPrompt_Click()
On Error GoTo ErrorPoint

Dim varPrompt As Variant

varPrompt = InputBox("Please enter a name.", "Enter Name")

' Name of my combo box is cboSomeName
Me.cboSomeName = varPrompt

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " & Err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint

End Sub

--
Jeff Conrad
Access Junkie
Bend, Oregon


  #3  
Old May 17th, 2005, 10:06 PM
dogpigfish
external usenet poster
 
Posts: n/a
Default

Thanks again

"Jeff Conrad" wrote:

"dogpigfish" wrote in message:
...

Any way to set up an inputbox prompt to fill in a combobox. I want an
inputbox to ask for a name. When I input the name I want the combobox to
show that name.


Something like so??
(I put this on a command button click event)

Private Sub cmdPrompt_Click()
On Error GoTo ErrorPoint

Dim varPrompt As Variant

varPrompt = InputBox("Please enter a name.", "Enter Name")

' Name of my combo box is cboSomeName
Me.cboSomeName = varPrompt

ExitPoint:
Exit Sub

ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " & Err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint

End Sub

--
Jeff Conrad
Access Junkie
Bend, Oregon



  #4  
Old May 17th, 2005, 10:37 PM
Jeff Conrad
external usenet poster
 
Posts: n/a
Default

"dogpigfish" wrote in message:
...

Thanks again


You're welcome, good luck with your project.
--
Jeff Conrad
Access Junkie
Bend, Oregon


 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
combobox value synchronization with actual record? zlatko Using Forms 2 March 2nd, 2005 10:47 AM
combobox value synchronization with actual record ? zlatko General Discussion 0 December 31st, 2004 07:13 PM
Combobox not displaying expected result. Mitch Using Forms 3 September 10th, 2004 05:14 PM
Selective Combobox? Annelie Using Forms 1 August 20th, 2004 04:08 AM
decision on Combobox Tony New Users 4 May 20th, 2004 03:58 PM


All times are GMT +1. The time now is 08:27 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.