Matt Needles wrote:
On Thu, 2006-02-09 at 15:22 +0100, Frank Schönheit - Sun Microsystems
Germany wrote:
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.
How disappointing :(
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
I am looking forward to Frank's answer about the visible property also,
in the mean time. Many moons ago I had the same needs with a forms
platform that also did not support a visible property and as is the
case with OO let me move the controls. The way it was solved then was
to create a routine that would move the controls off the visible screen
area and back. If you lock the screen updates while you do this you get
the same effect as setting them to not visible since they truly aren't
visible to the user. I haven't tried this with OO, so don't know how
the windows scroll bars will react, but it would be easy enough to find
out. I am sure however that all the support you need is already in the
API calls and moving the conrols is not much work at all. Especially if
all you are doing is sliding the one control on and off the viewable
area, as I recall we didn't even do much with trying to gauge the
screen areas size, just moved them to some rediculoulsy large X or Y
postion. Once they are moved off screen setting them enabled = false
should takes care of the tabbing issue, I think.
Well, tabbing order would be a minimal problem. But, what do you mean
by "kind of make..."? Can I make a control invisible, or can I not?
Drew
|