Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Input Box entry to a table ?

Geek News

Input Box entry to a table ?
Ms. DE Velop Her 11/7/2008 6:56:11 PM
I must place some code behind a command button (on a Form) that would prompt
the user for a batchID num , then add that input to a table field (BacthID)

Please advise the most feasible way / method

--
Thanks for your valuable time
RE: Input Box entry to a table ?
LT 11/7/2008 9:19:01 PM
It all depends on how complex you want to make it.

Easy Way
======
Just create a simple prompt using the InputBox:

Dim response As string
response = Trim(InputBox("Batch ID: ", "Input Required"))

Then you should add some checking to ensure that the user has actually
entered something; else either prevent them from continuing or prompt them
again.

Complex Way
=========
Build a form with another text box and just call Docmd.OpenForm to display
the form.

Personally I would just go with the InputBox function since you don't need
to rely on managing the state of multiple forms if further code execution is
required once the users input is complete.

Once you have the value then you can just either perform an insert or update
back to the table (you didn't indicate if a record already existed).

HTH,

Lance


"Ms. DE Velop Her" wrote:

[Quoted Text]
> I must place some code behind a command button (on a Form) that would prompt
> the user for a batchID num , then add that input to a table field (BacthID)
>
> Please advise the most feasible way / method
>
> --
> Thanks for your valuable time
Re: Input Box entry to a table ?
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 11/8/2008 2:28:33 AM
Ms. DE Velop Her wrote:
[Quoted Text]
> I must place some code behind a command button (on a Form) that
> would prompt the user for a batchID num , then add that input to a
> table field (BacthID)
>
> Please advise the most feasible way / method

The simplist way is to base the form on the table or a query based on the
table and add BacthID to that form.
Without knowing what comes next it's hard to be more specific.


RE: Input Box entry to a table ?
Ms. DE Velop Her 11/10/2008 4:18:00 PM
Are you speaking of using a recordset (DAO) to perform an insert or update ,
using RunSQL to the table??

The records exist, but I want the user to give me the batch number so that I
can place the bath number on the Batch Id Field of the table where the other
fields are populated. In other words, all records meeting the criteria of
having no blank fields, get the Batch number added and these records will be
used to make a Export table with the Batch number of "Whatever the user
assigns"
--
Thanks for your valuable time


"LT" wrote:

[Quoted Text]
> It all depends on how complex you want to make it.
>
> Easy Way
> ======
> Just create a simple prompt using the InputBox:
>
> Dim response As string
> response = Trim(InputBox("Batch ID: ", "Input Required"))
>
> Then you should add some checking to ensure that the user has actually
> entered something; else either prevent them from continuing or prompt them
> again.
>
> Complex Way
> =========
> Build a form with another text box and just call Docmd.OpenForm to display
> the form.
>
> Personally I would just go with the InputBox function since you don't need
> to rely on managing the state of multiple forms if further code execution is
> required once the users input is complete.
>
> Once you have the value then you can just either perform an insert or update
> back to the table (you didn't indicate if a record already existed).
>
> HTH,
>
> Lance
>
>
> "Ms. DE Velop Her" wrote:
>
> > I must place some code behind a command button (on a Form) that would prompt
> > the user for a batchID num , then add that input to a table field (BacthID)
> >
> > Please advise the most feasible way / method
> >
> > --
> > Thanks for your valuable time
Re: Input Box entry to a table ?
Ms. DE Velop Her 11/10/2008 4:31:03 PM
The users sees a form with record information from a table, the user then
modifys the table via the form entering data into the fields...once all
information added sucessfully, those complete records are to be appended to
another table for a export into a spreadsheet. But first the users needs to
assign a batch number to all records that will be exported
--
Thanks for your valuable time


"Mike Painter" wrote:

[Quoted Text]
> Ms. DE Velop Her wrote:
> > I must place some code behind a command button (on a Form) that
> > would prompt the user for a batchID num , then add that input to a
> > table field (BacthID)
> >
> > Please advise the most feasible way / method
>
> The simplist way is to base the form on the table or a query based on the
> table and add BacthID to that form.
> Without knowing what comes next it's hard to be more specific.
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net