Set a Bound Textbox's Value

  • Thread starter Thread starter Bruce M. Thompson
  • Start date Start date
B

Bruce M. Thompson

You can tell I am new to this, I am still pretty used to Excel, anyhow
If you have a bound textbox, and you are trying to set its value
without typing it in(using code) how do you do that?
When I try to do that I get the error that you cant set its value.
What I am trying to do is to take a comboxes value from a popup form
for the current month and year, (the form becomes invisible after you select
their values)and insert it into a bound textbox, so the user doesn't have to
keep entering the date for the report(the month may be a month behind,
depending on when they enter data). Is this the wrong approach?

If the field is a Date field, you must set it's value to a valid date, which
includes the month, date and year. Providing just the month and year will not
work. Is that what you're trying to do?
 
Hello Again,
You can tell I am new to this, I am still pretty used to Excel, anyhow
If you have a bound textbox, and you are trying to set its value
without typing it in(using code) how do you do that?
When I try to do that I get the error that you cant set its value.
What I am trying to do is to take a comboxes value from a popup form
for the current month and year, (the form becomes invisible after you select
their values)and insert it into a bound textbox, so the user doesn't have to
keep entering the date for the report(the month may be a month behind,
depending on when they enter data). Is this the wrong approach?
 
The fields I have set as text for the month and general number for the year.
What I am trying to accomplish is the have the heading of the report show
that its for January 2003, not January 01 2003.Can the value of the textbox
be set to that?
"Bruce M. Thompson" <bthmpson@big_NOSPAM_foot.com> wrote in message
 
The fields I have set as text for the month and general number for the year.
What I am trying to accomplish is the have the heading of the report show
that its for January 2003, not January 01 2003.Can the value of the textbox
be set to that?

Ah, you didn't say that the month and year values were stored in separate
fields - is this what you mean to say now? If so, your query's criteria should
be constructed as follows (watch line wrap - it's all on one line):

Between DateSerial([intYear],Month(cdate([strMonth] & " 1 " & [intYear])), 1)
And DateSerial([intYear],Month(cdate([strMonth] & " 1 " & [intYear]))+1, 0)

You need to replace "[intYear]" with a full reference to the control on your
form that contains the "year" number and "[strMonth]" with a full reference to
the control that contains the "month" string. If, on the other hand, both the
"month" and "year" values are combined in one textbox, then you should parse
both values out of the textbox and into two textboxes, as described, above, and
those would be the sources of the value references in the example above.
 
The fields I have set as text for the month and general number for the year.
If the textbox on the report is displaying the "Date" value, set its "Format"
property to:

mmmm yyyy

I guess I got a little carried away with my earlier responses, and I'm still not
sure that this is what you were asking. If not, please explain *exactly* all the
aspects of your dilemma so that any further responses will be more appropriate.
 
Back
Top