Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Populate dataform with combobox1.value

Ok. I give in. Tried for hours, and have search the forum and google.

Is it possible to populate a dataform with the combobox1 value. I can pick
up the value, but can't get it in to the dataform.

The code uses the form from the dropdown Data\Form. The form works thanks to
advice from Dave Peterson, however what I want to achieve is when the user
make a selection in the Combobox, they click on the update command button
which brings up the the dataform and the form default to the record
containing the value.
Possibly something along these line:

ActiveSheet.ShowDataForm
If ComboBox1.Value -1 Then
With Dataform
SendKeys "%c"
' SendKeys "{%}" + c
..Add (ComboBox1.Value)
SendKeys "%P"
' SendKeys "{%}" + P
End With
Else

End If

Any advice would be gratefully received.

Thanks,

--
Brian McCaffery
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Populate dataform with combobox1.value

You are getting astring back. Convert it to a date format using the
functtion datevalue. The data value string can be in any of the acceptabble
microsoft date formats.


mydate = datevalue("1/1/07")
I think for you code

..Add (datevalue(ComboBox1.Value))

"Brian" wrote:

Ok. I give in. Tried for hours, and have search the forum and google.

Is it possible to populate a dataform with the combobox1 value. I can pick
up the value, but can't get it in to the dataform.

The code uses the form from the dropdown Data\Form. The form works thanks to
advice from Dave Peterson, however what I want to achieve is when the user
make a selection in the Combobox, they click on the update command button
which brings up the the dataform and the form default to the record
containing the value.
Possibly something along these line:

ActiveSheet.ShowDataForm
If ComboBox1.Value -1 Then
With Dataform
SendKeys "%c"
' SendKeys "{%}" + c
.Add (ComboBox1.Value)
SendKeys "%P"
' SendKeys "{%}" + P
End With
Else

End If

Any advice would be gratefully received.

Thanks,

--
Brian McCaffery

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Populate dataform with combobox1.value

Thanks for the response. Will give it a try.
--
Brian McCaffery


"Joel" wrote:

You are getting astring back. Convert it to a date format using the
functtion datevalue. The data value string can be in any of the acceptabble
microsoft date formats.


mydate = datevalue("1/1/07")
I think for you code

.Add (datevalue(ComboBox1.Value))

"Brian" wrote:

Ok. I give in. Tried for hours, and have search the forum and google.

Is it possible to populate a dataform with the combobox1 value. I can pick
up the value, but can't get it in to the dataform.

The code uses the form from the dropdown Data\Form. The form works thanks to
advice from Dave Peterson, however what I want to achieve is when the user
make a selection in the Combobox, they click on the update command button
which brings up the the dataform and the form default to the record
containing the value.
Possibly something along these line:

ActiveSheet.ShowDataForm
If ComboBox1.Value -1 Then
With Dataform
SendKeys "%c"
' SendKeys "{%}" + c
.Add (ComboBox1.Value)
SendKeys "%P"
' SendKeys "{%}" + P
End With
Else

End If

Any advice would be gratefully received.

Thanks,

--
Brian McCaffery

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify code to reference from a Matching value in Combobox1 Corey Excel Programming 0 December 29th 06 04:47 AM
ComboBox1 grahammal Excel Discussion (Misc queries) 1 March 20th 06 12:33 PM
Endless Loop when using ComboBox1.BoundColumn = 2 shrekut Excel Programming 2 January 12th 04 01:46 PM
Deleting/Adding/Changing values based on ComboBox1 Value Todd Huttenstine[_2_] Excel Programming 4 December 13th 03 01:07 AM
3 textbox values based on value in ComboBox1 Todd Huttenstine[_2_] Excel Programming 2 November 10th 03 02:19 AM


All times are GMT +1. The time now is 08:57 PM.

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

About Us

"It's about Microsoft Excel"