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 drop down data for/of 30 days date



 
 
Thread Tools Display Modes
  #1  
Old September 8th, 2004, 02:59 PM
Np
external usenet poster
 
Posts: n/a
Default Combo box drop down data for/of 30 days date

Due to fast and hudge data entry I am looking for a
soltuion that I have a combo box, which is a date
datatype, in which every time I have to type date, which
is of any day of current month only.

Therefore, I will make my datefield change to Combo box
and in that combobox when I make it drop down it should
show me all the dates of the current month for example,
please note the below :

When combo box drop down, the data should show as :

01-09-2004
02-09-2004
03-09-2004
and so on till, I mean till end date of the current month
only.
30-09-2004

By this I will get a help, that I dont have type complete
date and I can just select it.

Note: This form and all its control is based on a table.

Please advise.







  #2  
Old September 9th, 2004, 10:16 AM
Nikos Yannacopoulos
external usenet poster
 
Posts: n/a
Default

Np,

Why go through all that jazz? Access offers two ActiveX controls, namely
Calendar Control and Microsoft Date and Time Picker, which you can use to do
exactly what you want! Try them out both to see which suits you better by
inserting them in a blank test form: Insert ActiveX Control ...
Just note that you will have to use a simple piece of code behind a suitable
form event, such as On Current, to make the control default in the current
date. If the control is bound, that should only happen on new records, so
the code would be:
If Me.NewRecord Then
Me.ActiveXControlName = Date()
End If

If the control is unbound, you should do that always, so simply:

Me.ActiveXControlName = Date()

Just change ActiveXControlName to the actual anme of the control.

HTH,
Nikos


"Np" wrote in message
...
Due to fast and hudge data entry I am looking for a
soltuion that I have a combo box, which is a date
datatype, in which every time I have to type date, which
is of any day of current month only.

Therefore, I will make my datefield change to Combo box
and in that combobox when I make it drop down it should
show me all the dates of the current month for example,
please note the below :

When combo box drop down, the data should show as :

01-09-2004
02-09-2004
03-09-2004
and so on till, I mean till end date of the current month
only.
30-09-2004

By this I will get a help, that I dont have type complete
date and I can just select it.

Note: This form and all its control is based on a table.

Please advise.









  #3  
Old September 9th, 2004, 01:50 PM
NP
external usenet poster
 
Posts: n/a
Default

Attn:. Mr. Nikos

Sir, Its my need to do that, because I cannot add any
thing additional on the form, Its a tabular type of form.
Actually, I have to feed about 100 of records every day,
out of which One field is a date field and the date is of
current month only, while posting the records, In one day
I get all dates of the month, about 20 are of different
date and 20 are of different, like this. I was trying to
escape 100 times typing the date, therefore, I was
thinking that I will make it a combo box from text box and
make such a attachment record source that It will show me
a drop down of complete date list from where I can select
any of the date by mouse.

Please, If you can ,suggest me any method.
regards.


-----Original Message-----
Np,

Why go through all that jazz? Access offers two ActiveX

controls, namely
Calendar Control and Microsoft Date and Time Picker,

which you can use to do
exactly what you want! Try them out both to see which

suits you better by
inserting them in a blank test form: Insert ActiveX

Control ...
Just note that you will have to use a simple piece of

code behind a suitable
form event, such as On Current, to make the control

default in the current
date. If the control is bound, that should only happen on

new records, so
the code would be:
If Me.NewRecord Then
Me.ActiveXControlName = Date()
End If

If the control is unbound, you should do that always, so

simply:

Me.ActiveXControlName = Date()

Just change ActiveXControlName to the actual anme of the

control.

HTH,
Nikos


"Np" wrote in

message
...
Due to fast and hudge data entry I am looking for a
soltuion that I have a combo box, which is a date
datatype, in which every time I have to type date, which
is of any day of current month only.

Therefore, I will make my datefield change to Combo box
and in that combobox when I make it drop down it should
show me all the dates of the current month for example,
please note the below :

When combo box drop down, the data should show as :

01-09-2004
02-09-2004
03-09-2004
and so on till, I mean till end date of the current

month
only.
30-09-2004

By this I will get a help, that I dont have type

complete
date and I can just select it.

Note: This form and all its control is based on a table.

Please advise.









.

  #4  
Old September 10th, 2004, 08:29 AM
Nikos Yannacopoulos
external usenet poster
 
Posts: n/a
Default

NP,

Ok, if that's how you want it; my proposed solution requires a lookup table
to hold the current month's dates, table name Current_Month_Dates, one date
type field called fldDate.
I have assumed the name of the combo on your form to be cboDate.
The idea is to fire a piece of VBA code on Form Open, which will clear the
existing records in the table and re-populate it wih the dates in the
current moth. The code looks something like:

Private Sub Form_Open(Cancel As Integer)
Dim strSQL As String
Dim rst As DAO.Recordset
strSQL = "DELETE * FROM Current_Month_Dates"
CurrentDb.Execute strSQL
Set rst = CurrentDb.OpenRecordset("Current_Month_Dates")
vDate = Date - Day(Date) + 1
rst.AddNew

Do
rst.Fields(0) = vDate
If Month(vDate) Month(Date) Then Exit Do
rst.Update
vDate = vDate + 1
rst.AddNew
Loop

rst.Close
Set rst = Nothing
Me.cboDate.RowSource = "SELECT fldDate FROM Current_Month_Dates"

End Sub

It requires a Microsoft DAO 3.xx Object Library reference to run.

Still, I'm not convinced this is the best solution; combos with ca. 30 rows
are not very convenient when the one you are looking for is not visible when
you open them, and you have to scroll down. You could still use a DT Picker
if you displayed continuous forms instead of datasheet and it would be
rather more convenient.
By the way, if dates repeat for twenty consecutive records or so, and then
change and repeat for another twenty and so on, I wouldn't use combos or DT
pickers or anything at all! I would just manually enter a date, and then in
all the subsequent records it is repeated just use Ctrl+' on my keyboard as
I type to repeat the previous record's entry in the particular
field/control. I'll bet you that's the fastest way when doing data entry on
the keyboard. Have you tried that?

HTH,
Nikos

"NP" wrote in message
...
Attn:. Mr. Nikos

Sir, Its my need to do that, because I cannot add any
thing additional on the form, Its a tabular type of form.
Actually, I have to feed about 100 of records every day,
out of which One field is a date field and the date is of
current month only, while posting the records, In one day
I get all dates of the month, about 20 are of different
date and 20 are of different, like this. I was trying to
escape 100 times typing the date, therefore, I was
thinking that I will make it a combo box from text box and
make such a attachment record source that It will show me
a drop down of complete date list from where I can select
any of the date by mouse.

Please, If you can ,suggest me any method.
regards.


-----Original Message-----
Np,

Why go through all that jazz? Access offers two ActiveX

controls, namely
Calendar Control and Microsoft Date and Time Picker,

which you can use to do
exactly what you want! Try them out both to see which

suits you better by
inserting them in a blank test form: Insert ActiveX

Control ...
Just note that you will have to use a simple piece of

code behind a suitable
form event, such as On Current, to make the control

default in the current
date. If the control is bound, that should only happen on

new records, so
the code would be:
If Me.NewRecord Then
Me.ActiveXControlName = Date()
End If

If the control is unbound, you should do that always, so

simply:

Me.ActiveXControlName = Date()

Just change ActiveXControlName to the actual anme of the

control.

HTH,
Nikos


"Np" wrote in

message
...
Due to fast and hudge data entry I am looking for a
soltuion that I have a combo box, which is a date
datatype, in which every time I have to type date, which
is of any day of current month only.

Therefore, I will make my datefield change to Combo box
and in that combobox when I make it drop down it should
show me all the dates of the current month for example,
please note the below :

When combo box drop down, the data should show as :

01-09-2004
02-09-2004
03-09-2004
and so on till, I mean till end date of the current

month
only.
30-09-2004

By this I will get a help, that I dont have type

complete
date and I can just select it.

Note: This form and all its control is based on a table.

Please advise.









.



 




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
QDE (Quick Date Entry) Norman Harker General Discussion 3 September 3rd, 2004 08:00 AM
How to create graphs in a monthly report where the base data can change John Clarke Charts and Charting 3 June 25th, 2004 02:22 AM
Using functions to count date format data dljudd Worksheet Functions 4 June 24th, 2004 09:25 AM
Adding a specified number of business days to a start date Frank Kabel Worksheet Functions 2 February 24th, 2004 04:46 PM
Does date fall between two ranges? MR Worksheet Functions 4 January 14th, 2004 04:08 PM


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