Populate the value in Input Box

  • Thread starter Thread starter little_rascals
  • Start date Start date
L

little_rascals

Hi, I need to allow the user to enter a report date manually. Therefore,
i've provided an input box.
However, i have no idea how to use that date entered by the user and
populate my information with that date.

Can some one kindly enlighten me on this?
Thanks lotZ!!!! :p
 
I'm not quite sure whether your question is about how to capture the user's
response, or what to do with it afterwards. The answer to the first part is
....


The InputBox function returns the text the user entered as its return value.

Dim strWhatever As String
strWhatever = InputBox( ... )

For the second part, I'm not sure what it is you want to do with the date.
I'm going to guess that you want to filter the reports recordsource for
records matching that date. If so ...

Private Sub Report_Open(Cancel As Integer)


Dim strTheDate As String

strTheDate = InputBox("Please enter a date in mm/dd/yyyy format.")
Me.Filter = "TestDate = #" & strTheDate & "#"
Me.FilterOn = True

End Sub
 
Hi Brendan,

Sorry for confusing you.
Yup.. you've got what i meant for the first part.
However, for the second part, I am not filtering the report
recordsource for records matching that date.

The situation is, I need to import data from a text file daily. One o
the fields in the table is "Report Date" and this field is not provide
in the text file therefore, this field is like an additional field i
the table.

For everyday's import of the text file, the user have to enter a repor
date, which is not equal to the system date, to the set of dat
imported each day.

So i need to "store" the report date entered in the input box and "add
it to the set of the records imported from the text file each day
 
Thanks for the clarification. But I can't offer any more specific advice
without knowing how you're importing the data.

BTW: While using an input box is a quick and easy way to get user input, it
gives you much less control over what gets entered than you can achieve
using a form. I'm not saying don't use it - it depends on the nature of the
application and the intended users. For an application intended for internal
use, it may be perfectly acceptable, provided you can trust those users to
be careful about entering correct dates.
 
Hi Brendan,

It is safe for me to use the input box because this Access applicatio
will be used internally.

As for how i will import the data, it is actually quite straigh
forward. Text files generated by a backend system will be sent to m
computer everyday. I am supposed to import the data in the text fil
into my Access table. For example, in the text file, there are field
like, Product ID, Product Name and Customer Name. The same fields wil
appear in my Access table. However, in my Access table, other tha
those fields which appear in the text file, i have an additional fiel
which is to be filled up in Access. The field is none other than th
"Report Date" field. I am supposed to provide an input box for the use
to enter the date and then using that date i am supposed to add it t
all the records which i just imported from the text file.

:
 
Back
Top