New database identification (1 Viewer)

saintsman

Registered User.
Local time
Today, 07:15
Joined
Oct 12, 2001
Messages
138
I wish to develop a simple database that will be used for one job to control all the spare parts that will need ordering for a particular job.

For each new job, the operators will take the template of the database, save it and use for just the one job. They will then repeat the process for the next job.

I have designed the database okay and use several tables. What I am unable to do at the moment is find a way of opening the new database so that the operator types in the job reference number once only and that reference is then attached to all the tables. Next time the database is opened there will then be no need to type in the reference.

Hope you can see what I am intended. All help appreciated.
 

namliam

The Mailman - AWF VIP
Local time
Today, 08:15
Joined
Aug 11, 2003
Messages
11,695
use a workvariables table where you store your number, once typed. Next time into the database simply read again from said table.

Regards
 

saintsman

Registered User.
Local time
Today, 07:15
Joined
Oct 12, 2001
Messages
138
Thanks for the suggestion, but unfortunately I need a few pointers. What is a works variable table (or a worksvariable)? I've tried the help and searched the forum to no avail.
 

namliam

The Mailman - AWF VIP
Local time
Today, 08:15
Joined
Aug 11, 2003
Messages
11,695
Create a table called tblJobNr
1 field, 0 records in your default DB
FieldName: JobNr


I am asuming you have some public variable in which you put the jobNR called YourJobNr
On Open of the database:
Code:
Dim rs as DAO.recordset
set rs = currentdb.openrecordset("tblJobnr")
if rs.eof then
' Jobno unknown
' ask first....
    rs.addnew
    rs!Jobnr = YourJobnr
    rs.update
else
    YourJobNR = rs!JobNr
endif
set rs = nothing

Or you can have them name the database the JobNR and then use Currentdb.name to retrieve it.... (truncing the .mdb and the full path)

Hope this helps

Regards
 

Users who are viewing this thread

Top Bottom