PC Review


Reply
Thread Tools Rate Thread

Combobox with current date

 
 
bbussoloti
Guest
Posts: n/a
 
      23rd Nov 2007
Hi,
I have 3 combo boxes that corresponds to day, month and year. When the user
opens my form, those values should be automatically with the current day,
current month and current year, but also open to change it.
I can make the values to be changeable, but i can´t set those current date
values.
I tried with no success all of those below:

With insereForm
.Show
.ComboDay1.Value = Format(Now, "dd")
.ComboDay1.Value = Format(Date,"dd")
.ComboDay1.Value = Day
End With

 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      23rd Nov 2007
What about this?

..ComboDay1.Value = Day(Now)

Rick


"bbussoloti" <(E-Mail Removed)> wrote in message
news:E5A27B40-7BE3-4AA9-99EC-(E-Mail Removed)...
> Hi,
> I have 3 combo boxes that corresponds to day, month and year. When the
> user
> opens my form, those values should be automatically with the current day,
> current month and current year, but also open to change it.
> I can make the values to be changeable, but i can´t set those current date
> values.
> I tried with no success all of those below:
>
> With insereForm
> .Show
> .ComboDay1.Value = Format(Now, "dd")
> .ComboDay1.Value = Format(Date,"dd")
> .ComboDay1.Value = Day
> End With
>


 
Reply With Quote
 
bbussoloti
Guest
Posts: n/a
 
      23rd Nov 2007
..ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the
focus first, but no good.



"Rick Rothstein (MVP - VB)" escreveu:

> What about this?
>
> ..ComboDay1.Value = Day(Now)
>
> Rick
>
>
> "bbussoloti" <(E-Mail Removed)> wrote in message
> news:E5A27B40-7BE3-4AA9-99EC-(E-Mail Removed)...
> > Hi,
> > I have 3 combo boxes that corresponds to day, month and year. When the
> > user
> > opens my form, those values should be automatically with the current day,
> > current month and current year, but also open to change it.
> > I can make the values to be changeable, but i can´t set those current date
> > values.
> > I tried with no success all of those below:
> >
> > With insereForm
> > .Show
> > .ComboDay1.Value = Format(Now, "dd")
> > .ComboDay1.Value = Format(Date,"dd")
> > .ComboDay1.Value = Day
> > End With
> >

>
>

 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      23rd Nov 2007
Exactly what is the ComboBox populated with and how did you populate it? And
which ComboBox are we talking about... on the worksheet from the Forms
Toolbar, on the worksheet from the Control Toolbar or on a UserForm from
within VBA?

Rick


"bbussoloti" <(E-Mail Removed)> wrote in message
news9EA68DF-5225-4AB0-94BD-(E-Mail Removed)...
> .ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the
> focus first, but no good.
>
>
>
> "Rick Rothstein (MVP - VB)" escreveu:
>
>> What about this?
>>
>> ..ComboDay1.Value = Day(Now)
>>
>> Rick
>>
>>
>> "bbussoloti" <(E-Mail Removed)> wrote in message
>> news:E5A27B40-7BE3-4AA9-99EC-(E-Mail Removed)...
>> > Hi,
>> > I have 3 combo boxes that corresponds to day, month and year. When the
>> > user
>> > opens my form, those values should be automatically with the current
>> > day,
>> > current month and current year, but also open to change it.
>> > I can make the values to be changeable, but i can´t set those current
>> > date
>> > values.
>> > I tried with no success all of those below:
>> >
>> > With insereForm
>> > .Show
>> > .ComboDay1.Value = Format(Now, "dd")
>> > .ComboDay1.Value = Format(Date,"dd")
>> > .ComboDay1.Value = Day
>> > End With
>> >

>>
>>


 
Reply With Quote
 
perjessen69@hotmail.com
Guest
Posts: n/a
 
      23rd Nov 2007
On 23 Nov., 19:45, bbussoloti <bbussol...@discussions.microsoft.com>
wrote:
> .ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the
> focus first, but no good.
>
> "Rick Rothstein (MVP - VB)" escreveu:
>
>
>
> > What about this?

>
> > ..ComboDay1.Value = Day(Now)

>
> > Rick

>
> > "bbussoloti" <bbussol...@discussions.microsoft.com> wrote in message
> >news:E5A27B40-7BE3-4AA9-99EC-(E-Mail Removed)...
> > > Hi,
> > > I have 3 combo boxes that corresponds to day, month and year. When the
> > > user
> > > opens my form, those values should be automatically with the current day,
> > > current month and current year, but also open to change it.
> > > I can make the values to be changeable, but i can´t set those current date
> > > values.
> > > I tried with no success all of those below:

>
> > > With insereForm
> > > .Show
> > > .ComboDay1.Value = Format(Now, "dd")
> > > .ComboDay1.Value = Format(Date,"dd")
> > > .ComboDay1.Value = Day
> > > End With- Skjul tekst i anførselstegn -

>
> - Vis tekst i anførselstegn -


Try

.ComboDay1.AddItem Day(Now)

Regards

Per
 
Reply With Quote
 
SAPkannan@gmail.com
Guest
Posts: n/a
 
      24th Nov 2007
Hi,

Try this one hopes it works

ComboBox1.Value = Format(Now, "dd")
ComboBox2.Value = Format(Now, "mm")
ComboBox3.Value = Format(Now, "yyyy")

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning current value to default for date ComboBox not working? LotusEater Microsoft Access VBA Modules 1 7th Aug 2009 05:45 PM
ComboBox: Update a value in current record before changing the ComboBox Value disneygoof via AccessMonster.com Microsoft Access Form Coding 2 17th Mar 2008 02:43 PM
Can I automatically enter the current date or current time into a =?Utf-8?B?QmVu?= Microsoft Excel New Users 7 19th Oct 2005 03:38 PM
Calculate date difference between fixed date and current date Dave Elliott Microsoft Access Forms 3 23rd May 2005 03:54 AM
current date & time & current user =?Utf-8?B?Sm93ZW4=?= Microsoft Access 1 5th Feb 2005 07:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:41 AM.