Generating and Populating field data On Load

N

Niz406

Hi All Newbie here...

I'm having problems trying to figure out how to do the following:

Insert into an Access DB table the date from a hidden text box using the
now() function that only happens once as in when the reference text box is
populated the date will not change, and then select an Auto number as a
reference number for a different text box that was created by inserting the
date in the previous step.

This will obviously be in an If statement to check if the refreence number
form field is blank. for example:

If txtReference ... 'code to check if its blank or not' Then

Populate the reference table using the date in the form of the following
SQL that relates to the hidden text box. Once this SQL has been fired, then
pull back the reference number for the date that has been inserted in the
text box.

Else

Do nothing

End If

or something similar, in all honesty I have no idea what I'm doing with the
coding, I have done the form creation without the need for scripts or coding
of any sort, but now other managers want to see further functionality that I
have had no experience in.

So any help would be great.

Does my question make any sense?
 
C

Clay Fox

I would recommend letting the database autonumber, that makes generating new
rows much simpler and less problem prone.

I would also recommend you check out the database accelerator download at
hyyp://www.qdabra.com
It will give you a bunch of tools for interacting with your DB.
--
Thanks

Clay Fox

Qdabra Software
http://www.qdabra.com

InfoPathDev.Com
The Largest InfoPath Forum in the World
http://www.infopathdev.com
 
N

Niz406

Hi Chap,

I've set up the db with an auto number field, the date text box is used as
the field to enter and create a new record. The record gives us the reference
number and the date and time that form was populated.

It's just so that the form can have a unique reference from the db when it
is first opened.

The only other way would be to include a counter that reads how many records
are in the db and then add's 1 to that number as the new reference number and
stores the information on submit.

This is the last part of the form I'm stuck on and I've been stuck on it for
a few weeks now, I have brought 3 books but they do not give any kind of
example close to this. I've tried searching the internet and coding my own
versions.. but being new to JScript etc.. it never seems to work. :eek:)

Any further help would be great!

Many thanks
 

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