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  

clear combo data on add- [comboboxname].ItemData(n) not working



 
 
Thread Tools Display Modes
  #1  
Old February 21st, 2006, 02:35 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default clear combo data on add- [comboboxname].ItemData(n) not working

I am trying to clear the previous combo box data data on a form when adding -
this is the statement I am using in the form's default value for the field
[comboboxname].ItemData(0) - The first record in each combo box is a blank.

Why is this not working?
  #2  
Old February 21st, 2006, 04:35 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default clear combo data on add- [comboboxname].ItemData(n) not working

I'm assuming that the form is a data bound form and the combo box is also
data bound?


"DianaH" wrote:

I am trying to clear the previous combo box data data on a form when adding -
this is the statement I am using in the form's default value for the field
[comboboxname].ItemData(0) - The first record in each combo box is a blank.

Why is this not working?

  #3  
Old February 21st, 2006, 04:39 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default clear combo data on add- [comboboxname].ItemData(n) not working

Try adding this code on the current event.

Private Sub Form_Current()
If Me.NewRecord Then ' a new record
Me.Combo0.DefaultValue = Me.Combo0.ItemData(0)
End If
End Sub

"DianaH" wrote:

I am trying to clear the previous combo box data data on a form when adding -
this is the statement I am using in the form's default value for the field
[comboboxname].ItemData(0) - The first record in each combo box is a blank.

Why is this not working?

 




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
How do I save an access document in word document? cmartin General Discussion 2 September 13th, 2005 11:26 PM
Format on data to import to Access tables? (I need your advice) Niklas Östergren General Discussion 5 December 13th, 2004 02:54 PM
How do I get 3 series in sync with the x-axis? zizbird Charts and Charting 10 October 25th, 2004 01:23 PM
combo box with query as data source Simon Wong Using Forms 2 October 14th, 2004 10:13 AM
Is this possible with Excel Chart? q582gmzhi Charts and Charting 1 September 8th, 2004 03:33 AM


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