Wizard problem!

  • Thread starter Niklas Östergren
  • Start date
N

Niklas Östergren

Hi!

I´m about to finish a entry wizard in my application when I came to think of
one scenario that the user might want to handle.

The wizard is helping the user to registrate a person as a member in out
assosiation. In the first form (frmNewMemberApplyRegistration, recordsource
= tblPerson) the user enters the persons name, address etc. In the second
form (frmNewMemberRegistration, recordsource = tblMember) the user enters
all member data such as MemberNo, the date the person joined the
assosiation. And in the third form (frmNewMemberShipRegistration,
recordsource = tblMemberValidation) the user enters membership data, such as
type of membership (single, family, etc.), expire date etc.

The relationships between the tables are as follows:

tblPerson....................................tblMemberValidation............
..................tblMember

PersonID (PK) (One------Many)...fkPersonID
.......................................................fkMemberID
(Many----------One) MemberID (PK)

My wizard works just fine all the way (I have more form´s then I have
declared here). And the user can step forward and backwards in the wizard
and finish when ever they wants to. So what´s my problem then?

Well, in hte first form the user can only enter ONE record (ONE FirstName,
ONE LastName etc.) but if the person wants to applye for a family membership
then the user needs to register several names, which isn´t any problem (I
havn´t created this part yet but it will not be any problem).

Today I use several global variables (like glngNewPersonID as Long,
glngNewMemberValidation as Long and glngNewMemberID) to store each new
record so I can delete them when neded to (when the user go backwards
(cmdPrevious) in the wisard or abort (cmdAbort) the wizard. Her´s my Q:

How do I solve the problem with several persons in tblPerson and several new
memberships in tblMemberValidation end so on?

I know one way of doing it but I think there might be a smother solution.
The one that I know of is to create a seperat table in which I store all the
primary keyes needed for the wizard and name the records with what type of
primary key it is and then loop throug this table and delete all records in
tblPerson where stored primary key for <PersonID> = tblPerson.PersonID.

Isn´t there a smother (better way of doing this. How about using an array to
store the primary keyes in? Is that possible (better)?

I have never used an array and doesn´t know how to. I have several good
books so I´ll be able to read and learn. But is this the way to go, or???

TIA!
// Niklas
 
N

Niklas Östergren

Maby I need to explane my selfe here, I read throug my msg and found it some
missleading in some parts.

What I need help with is which way to go to make it possible to selecte the
correct (new) records that just was created by the user throug the wizard.
Today I store ONE primary key in ONE global variable. So I use this global
variable to find out which record to delete. I have one global variable for
each table in which I store a newly created record.

The part that I don´t know how to solve is how I´m going to store and
retrive seversl primary keys when I need to delete several records. Shall I
store them in a table, shall I store them in an array?

If array, how do I do this and how do I retreve the data when I´m about to
delete the records?

I hope this was a little bit clearer!?

TIA
// Niklas
 
G

Guest

For the wizard you may think of using a TAB control on a single form. The
wizard simply changes the tab page. This way you do not create anything until
you have gathered all data. You may want, however, to validate data on each
page before moving to the next.
Using the TAB control makes it very easy to move backwards in the wizard
HTH
Terry
 

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