Hi Matt,

> I am learning to program macros to make a dynamic form for my database.
> I have an address table called tblAddresses and a form called
> frmAddressEntry.  One field of the table, RecType,  can have the values
> of "O" or "I" for Organization or Individual.  If the record is "O",
> then the fname (first name) field is blank, and the Organization Name is
> stored in the lname (lastname field).  I want the form to appear with
> only the lname control visible, covering the fname control, if the
> RecType is "O", and both fname and lname visible if RecType is "I".
> Also, if the RecType is changed, the visible fields should change
> accordingly. How do I do this?

You hardly can :(

Unfortunately, form controls don't have such a thing as a "visible"
attribute, so everything you'd do here would be quite some manual work.

You could, depending on the RecType value
- enable or disable controls, and change label texts (not really what
you want)
- fiddle with the geometry information of the shapes to which the
controls belong
- use the control.getPeer().setVisible (IIRC) to kind of make the
control invisible, but this might have side effects (I'm not sure if the
control participates in the tabbing order, for instance)

Not really satisfying, admittedly ....

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to