Opening and Closing Forms. Saving the Records.

G

Guest

I'm totally new to Access but by reading the postings and various "Help"
screens I've managed to create a questionnaire which I think follows the
relational rules. (I should mention that I "put the cart before the horse"
and wrote the questionnaire, which has now been completed by approximately
600 people! I thought I'd be able to use an analysis package which came with
another questionnaire but it has proved to be completely incompatible.)
I was earlier referred to Dave Hookom's library and downloaded "At Your
Survey" but this doesn't help me much.
I've created a table for each question and an associated form and can enter
data. I've also put buttons on the bottom of each form which allows me to go
to the next form or the previous one but I find as I step through the
questionnaire, I end up with a series of open forms. When I get to the last
form, I don't know how to save the data and then go to the beginning of a new
record.

My questions are therefore:
1. How do I close the form I've just left, whether I'm advancing through the
questionnaire or going back to check an entry on the previous form?
2. How do I save the input data on each form and then on the last form, go
to the start of a new record?

I might add that I have never written a macro or any code so I'm really on
a steep "learning curve". I've seen things in other posting like, "Dim
Me.Dirty" etc but don't know what they mean. I've also seen various lists of
recommended books from Jeff Conrad but is there a real "idiot guide" for
people like me with just a little knowledge?
 
D

Duane Hookom

What's unique about your survey that requires you to "I've created a table
for each question and an associated form"? Your statement "but this doesn't
help me much" doesn't help us much in determining why you can't apply a more
normalized solution.
 
G

Guest

Duane,

My response of yesterday doesn't seem to have been posted. The gist of it
was that "I'm sure there is nothing unique about it."
I bought Access 2003 Inside Out and have followed the rules regarding
design etc. and I'm fairly sure that it is "normalised".
My problem is going from one form to the next at the same time as closing
the one I've just left. Likewise, when I get to the last form in the series I
want to be able to close that form and go the first one to start creating
another record.
Since posting my response last night, I played with some of the code and
managed to use a button to go to the next form whilst saving and closing the
one I'd just left.
The code I used was written by the wizard and I inserted one line as
indicated below:

Option Compare Database
Private Sub Form_9_to_10_Click()
On Error GoTo Err_Form_9_to_10_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form10"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "Form9", acSaveYes (This is the line I inserted)
Exit_Form_9_to_10_Click:
Exit Sub
Err_Form_9_to_10_Click:
MsgBox Err.Description
Resume Exit_Form_9_to_10_Click
End Sub

It seems to work ok but I don't know if I'm going about it the correct way.

I think one of my problems is that 2003 Inside Out probably assume the
reader has basic programming skills, which I lack. I've seen Jeff Conrad's
posting regards "Free Access Training" and is there one among the list which
will take me through coding; commands, syntax, etc?

Regards, John
 
D

Douglas J Steele

If you have one table per question, then I'd hazard a guess that it's not
normalized.

If nothing else, you're "hiding" data (i.e.: the question number) in the
name of the table.
 
G

Guest

I used Duanes solution for my questionnaire it worked perfectly well, i dont
believe in reinventing the wheel, i also do not believe your database is
properly normalised, this will create problems in the future
 
G

Guest

I totally agree with not reinventing the wheel but I'm obviously missing
something crucial. I'll go back to the beginning and try again.
Thanks everyone.
 

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