pleass ehelp

E

Edwin Merced

If I click a yes/no field I need a long paragraph to be associated with that
click. I have 3 fields like this. Each field has a differnet paragraph.
Question is: I dont know where the paragraph for each yes/ no field goes (in
the default value?? in another table?) Eventually I want to filter the
yes/no fields and only print (in a repor) those paragraphs where the yes/no
field has been clicked

I really would appreciate the help
 
J

James Hahn

Create a table that contains your paragraph text as a field. The records in
this table will also have a simple reference number (1, 2, 3 ...) field as
the primary key. In the original table, create a field for each Yes/No to be
the associated paragraph number field. When the user selects Yes (or No),
put the paragraph number (or zero) into the field as appropriate. Then when
you report, you can check for zero, meaning there is no paragraph, or access
the paragraph using the paragraph number stored in each field. You could
create a paragraph number 0 with no text, so that you don't even need to
test for it.
 
E

Edwin Merced

Ive got the first part but how do I "put the paragraph number (or zero) into
the field "

Thanks
 
J

James Hahn

In the yes/no field, use the After Update event procedure to execute a code
module that sets the associated number field. From my database, the code is
If [Discontinued] Then [Reason] = 3 Else [Reason] = 0

This will insert a reason code of 3 if the product is flagged as
discontinued, otherwise the reason code will be set to 0.
 
E

Edwin Merced

Where do I reate the procedure in Modules? or inside the field? . How do I
relate the procedure to the the field? Sorry for asking so much..


James Hahn said:
In the yes/no field, use the After Update event procedure to execute a
code module that sets the associated number field. From my database, the
code is
If [Discontinued] Then [Reason] = 3 Else [Reason] = 0

This will insert a reason code of 3 if the product is flagged as
discontinued, otherwise the reason code will be set to 0.
--

Edwin Merced said:
Ive got the first part but how do I "put the paragraph number (or zero)
into the field "
 
J

James Hahn

You may need to read up on creating code modules. In Form Design view, Right
click the field, select properties and events and select the After update
event. Choose Event procedure from the list. A pro-forma afterupdate
procedure will be created for you. Enter the code in the procedure.

Now, whenever the value of the yes/no field is entered in the form, the
associated paragraph number field will change.
 
E

Edwin Merced

This soudns interesting James. Thanks Ill look into it and get back to you
THANX
 
J

James Hahn

Field names. In my example the yes/no field was named Discontinued and the
associated paragraph number field was named Reason.
 
E

Edwin Merced

My question now is, if yes/no fields are on one table and thememo fiedls on
anaother table, Do I have to name the tables or does the relationship
established between the two tables knows which field Im referencing?
 
J

James Hahn

If you are talking about the form, then you can ignore the other table. The
procedure I have suggested involves two fields on the one form - the
original yes/no field and a new numeric field that contains the paragraph
number. The paragraph number is set to a particular value if the yes/no
field is y. That's all that happens on the form.

When it comes to a report or a query, you have to establish a relationship
for the two tables so that the paragraph number in the original table
accesses a record in the paragraph table (one to one). The relationship is
between the paragraph number field (Reason in my example) and the primary
key of the record in the paragraph table. The result is that when you
report or query on a record the text from the paragraph record that matches
the paragraph number is displayed.
 
E

Edwin Merced

Thanks James for your patience follwing up on me. Is there any chance I can
take a look at your example or is there a way I can let you take a look at
what I have so far?
 
J

James Hahn

I have arranged for a sample database to be supplied. If the email address
you are using is not correct or the sample is in the wrong version of
Access, please reply here.
 
E

Edwin Merced

Hello James
Ive got the file. Thanks.
I still dont seem to understand how I should grab the paraghraph number and
associate it with the memo field.
Is it OK if I send you my example?
Ive got the part of checkbox with paragraph number donde Thats fine but when
it comes to relate the number with the paragraph Im a little lost.
Because eventually I need the paragraphs for a report. And not only that but
diffrent records will have diffrenmt amounts of paragraphs (depending on
their selecttion. Can I make sucha dynamic report (you see some wll hve no
parapgras and other can have up to 11 paragraphs.
Let me knmow if you can take a llook at my file

Thanks again

Edwin
 
J

James Hahn

The example report I included shows how to use the paragraph number to
collect the paragraph text and include it in the report. The sample data I
provided included items with zero, one and two paragraphs. Have you run the
report with the sample data?

I am not able to send or to receive attachments. If you can post your
example to a www site I can look at it there.
 
Top