Gianni
|
| Posted: 10/18/2002, 2:31 AM |
|
Hi,
How can I hide a detail form when inserting a record in a master form?
The problem is: I cannot add child records if I haven't completed parent record insertion. If child form grid appears when I'm inserting the parent record, user can get confused.
I would like the child grid form be displayed only in update mode of the parent form.
Thank you for your help.
Gianni
|
|
|
 |
Andrew B
|
| Posted: 10/18/2002, 10:34 AM |
|
This is how you can do it
1. Declare a variable in the 'open' event for the entire page. This will let you use it anywhere (i.e. on both forms).
dim m_HideDetail
2. In the 'open' event of your master form, insert this code :
if (bPK = false) then
m_HideDetail = true
else
m_HideDetail = false
end if
3. In the 'open' event of the form you want to hide, put this code :
if (m_HideDetail = true) then
SetVar "FormMyFormName", ""
exit sub
end if
That should do it, at least it does it for me :)
end if
|
|
|
 |
Andrew B
|
| Posted: 10/18/2002, 10:37 AM |
|
Well, you didn't say it but the title of your post says 'CC' so I assumed CodeCharge. If you are using CodeCharge studio this will not work.
|
|
|
 |
|