Form question

G

Guest

I designed a database to collect data from questionnaires for a study. Once
the data collection is completed, the data will be exported as a dbase IV
file then imported into SAS for data analysis. So I have one table (there
are less than 50 fields) that is the record source for 6 forms (one for each
page of the questionnaire). Thus, I did not design this as a relational
database.

I want each form to act as each page of the questionnaire with command
buttons at the bottom of each form that will allow the data entry person to
open the next form/page and continue entering data for each page until
finished. As each form is being opened, I want the ID field to automatically
appear. That is not happening at the moment, but when I close out of each
form and reopen, the IDs appear. Can you tell me why that is happening and
what I can do to make the ID field automatically appear when opening each
form up?

Thanks,

ty
 
G

Guest

What type of control is the ID in?
How do you get it there in the beginning?
Will the ID be the same for each page, or a different ID for each page?

Knowing a little more, maybe I can help.
 
I

Immanuel Sibero

Hi Tracy,

Better yet, look into the use of tabcontrol on a form. You would only need
one form with multiple tabs where each tab contains various different set of
fields of your choice (i.e. pages of your questionnaire). This scheme also
addresses some other issues you're having by using multiple forms (i.e.
synchronizing the record loaded on the various forms, etc).

HTH,
Immanuel Sibero.
 
G

Guest

Thanks, Immanuel. That was what I decided to do, since I have done that
before. I just wanted to go with a different look--which would entail more
advanced VBA programming skills then I have.

I do have a new question though. When using tabcontrols, how do you use the
SetFocus Property to navigate from last field on page 1 to the first field on
page 2. I need more code than Forms!Field A.SetFocus? Do I need to add
something re: the particular tab page I am trying to navigate to? Thanks.

Tracy
 
I

Immanuel Sibero

Tracy,
I think you got it right. I have not had to do that (i.e. have always let
the users decide which tab they want to go to).
So, assuming FieldA is the first field on the next tab, you would simply do:

Me!FieldA.SetFocus

You would code this behind the last field in your tab order on page 1. Use
the OnLostFocus or OnExit event handler. It also appears that you dont have
to worry about which tab you're trying to go to. Refering directly to FieldA
will set focus to FieldA no matter which tab it resides.


HTH,
Immanuel Sibero
 
G

Guest

Thanks again, Immanuel.

How would you write your code if you wanted to set focus from the last field
of the last page to the first field of the first page, which happens to be
the ID field (this field is on every page)? Do I need to add in some type of
Pages Control statement with the SetFocus Method?

Also, is there a way to change the 'Yes' values of a check box from -1 to 1?
Or do you have to do that in the data analysis phase (i.e., if exporting as a
dbf file into statistical software package like SAS)? Thanks.

Tracy
 
I

Immanuel Sibero

How would you write your code if you wanted to set focus from the last field
of the last page to the first field of the first page, which happens to be
the ID field (this field is on every page)? Do I need to add in some type of
Pages Control statement with the SetFocus Method?

If you tab out of the last field of the last page, you will go to the next
record. Without adding any code, I think you will find yourself on the first
field of the last page of the next record. If you want to be placed on the
first field of the first page of the next record:

Set the tab page focus by adding code in the OnCurrent event of the form:

Me!TabControl.Pages("FirstPage").SetFocus
Me!IDField.SetFocus 'you dont need this line if you IDField is the first
field in the tab order.

Also, is there a way to change the 'Yes' values of a check box from -1 to 1?
Or do you have to do that in the data analysis phase (i.e., if exporting as a
dbf file into statistical software package like SAS)? Thanks.

Microsoft's value for True is -1. I wouldnt change it. I would take your
suggestion by changing it at analysis time when necessary. Use a calculated
field in a query:

ExportField:iif([CheckBoxField],1,0)


Immanuel Sibero
 

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