Days of the month in the X-axis of a graph

G

Guest

Hello,

I have a table that collects production by date. In a form I added a combo
box to select a month of the year and a graph that will show production by
day of that month. I would like to have in the x-axis of that graph all days
of that month, regardless whether the production table has entries for that
day or not. I first thought of creating a table with the days of the month,
but the problem is that depending on the month, the axis should show 28, 30,
or 31 days. How can generate the values for the x-axis of my graph based on
the month and year selected in the combo box?

Thanks!
 
B

Bob Quintal

Hello,

I have a table that collects production by date. In a form I added
a combo box to select a month of the year and a graph that will
show production by day of that month. I would like to have in the
x-axis of that graph all days of that month, regardless whether
the production table has entries for that day or not. I first
thought of creating a table with the days of the month, but the
problem is that depending on the month, the axis should show 28,
30, or 31 days. How can generate the values for the x-axis of my
graph based on the month and year selected in the combo box?

Thanks!
Create the table, with days from 1 to say 36. :)

Modify the month combobox to add a hidden column that contains the
last day of the month 28,30,31) Create a hidden textbox on the form,
with the control source set to =combobox.column(n) where n is the
zero-based count of the column from the left.

Filter the query that uses your table to be <=[forms!whatever!
textbox
 
G

Guest

Thanks, but I will need some extra help with this. I ended up with a table
that gives me the numbers from 1 to 31, a combo box that gives me a month,
and a combo box that gives me a year. I would need to put all that together
to come up with a date that I could link to my daily production table. Could
you please help me with this?

Thanks again!

Bob Quintal said:
Hello,

I have a table that collects production by date. In a form I added
a combo box to select a month of the year and a graph that will
show production by day of that month. I would like to have in the
x-axis of that graph all days of that month, regardless whether
the production table has entries for that day or not. I first
thought of creating a table with the days of the month, but the
problem is that depending on the month, the axis should show 28,
30, or 31 days. How can generate the values for the x-axis of my
graph based on the month and year selected in the combo box?

Thanks!
Create the table, with days from 1 to say 36. :)

Modify the month combobox to add a hidden column that contains the
last day of the month 28,30,31) Create a hidden textbox on the form,
with the control source set to =combobox.column(n) where n is the
zero-based count of the column from the left.

Filter the query that uses your table to be <=[forms!whatever!
textbox
 
B

Bob Quintal

Thanks, but I will need some extra help with this. I ended up with
a table that gives me the numbers from 1 to 31, a combo box that
gives me a month, and a combo box that gives me a year. I would
need to put all that together to come up with a date that I could
link to my daily production table. Could you please help me with
this?

Thanks again!
To give you the actual code, I need the form's name, the combobox
names for year and month as well as table and field names from the
new table. However the general concept is to create a new query that
contains a date formed by the concatenation of the combobox values
and the day number using the dateserial() function

the SQL will look something like this:
SELECT dateserial(Year(Forms!Formname!cboyear),month(Forms!Formname!
cbomonth),[numberfield]) AS everyday FROM [tablename] ORDER BY
everyday;



Bob Quintal said:
Hello,

I have a table that collects production by date. In a form I
added a combo box to select a month of the year and a graph
that will show production by day of that month. I would like to
have in the x-axis of that graph all days of that month,
regardless whether the production table has entries for that
day or not. I first thought of creating a table with the days
of the month, but the problem is that depending on the month,
the axis should show 28, 30, or 31 days. How can generate the
values for the x-axis of my graph based on the month and year
selected in the combo box?

Thanks!
Create the table, with days from 1 to say 36. :)

Modify the month combobox to add a hidden column that contains
the last day of the month 28,30,31) Create a hidden textbox on
the form, with the control source set to =combobox.column(n)
where n is the zero-based count of the column from the left.

Filter the query that uses your table to be <=[forms!whatever!
textbox
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top