Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: combobox


Message #1 by "Nikola" <Nikola@B...> on Tue, 20 Aug 2002 08:34:38 +0300
Hi all,

If anyone can give me same advice and help me with my confusion.
On mainform (orders) I have checkbox. When I click on check box
subform(Quotation) is visible. Subform is in  continues form view and have
only one combobox (suppliers) so i use subform just to select more then one
supplier for 1 order, I was thinking to make listbox but supplier list have
1400 record .In subform is command button for print  preview .Now hire is my
questions :
1. when  close report I want subform to be invisible.
2. How to make if I go to n record and checkbox is selected so if I click
again on checkbox is possible for that checkbox stay true but to make
subform visible to add more supplier?
and is same another way to make this subform?
 Thanks in advance

Fule



Message #2 by "Steven White" <Steve.White@m...> on Tue, 20 Aug 2002 07:10:04
If you copy the same Event Procedure from the checkbox to the Forms "On 
Current" event, it should solve your problem.

eg. if your checkbox change, click or exit event procedure is

If chkBox = -1 then
   Subform.Visible=True
Else
   Subform.Visible=False
End If

you can copy that directyly to the Form Current event.
So for each record you go to, the visibility of the subform will be based 
on whatever the checkbox value is. 

Steven
Message #3 by "Nikola" <Nikola@B...> on Tue, 20 Aug 2002 11:01:38 +0300
Steven thanks for replay,
This part is ok but my main form is to big so subform is visible only when
you click on chkBox ,than you select supplier from combobox,click on print
and subform is invisible. But if i go back to record where i select chkBox
from before the only way to make subform visible is to unselect and then
select again chkBox ...so is same another way to make this ?

-----Original Message-----
From: Steven White [mailto:Steve.White@m...]
Sent: Tuesday, August 20, 2002 7:10 AM
To: Access
Subject: [access] Re: combobox


If you copy the same Event Procedure from the checkbox to the Forms "On
Current" event, it should solve your problem.

eg. if your checkbox change, click or exit event procedure is

If chkBox = -1 then
   Subform.Visible=True
Else
   Subform.Visible=False
End If

you can copy that directyly to the Form Current event.
So for each record you go to, the visibility of the subform will be based
on whatever the checkbox value is.

Steven




Message #4 by John Fejsa <John.Fejsa@h...> on Wed, 21 Aug 2002 09:26:59 +1000
Use Form_Current procedure to determine whether to show or hide the subform.  

For example:

Private Sub Form_Current()
On Error GoTo Err_Form_Current

    If   Me!chkBox then      'If Me!chkBox has been clicked
         Me!MySubform.Visible = True   'Show the required subform
    Else
        Me!MySubform.Visible = False   'Hide the required subform
    End If

Exit_Form_Current:
    Exit Sub

Err_Form_Current:
    MsgBox err.Description, vbCritical, "Error on Form Current!"
    Resume Exit_Form_Current
End Sub



____________________________________________________

John Fejsa
Systems Analyst/Computer Programmer
Hunter Centre for Health Advancement
Locked Bag 10, WALLSEND NSW 2287
Phone: (02) 4924 6336 Fax: (02) 4924 6209
www.hcha.org.au
____________________________________________________

The doors we open and close each day decide the lives we live
____________________________________________________

CONFIDENTIALITY & PRIVILEGE NOTICE
The information contained in this email message is intended for the named addressee only.  If you are not the intended recipient you
must not copy, distribute, take any action reliant on, or disclose any details of the information in this email to any other person
or organisation.  If you have received this email in error please notify us immediately.

>>> Nikola@B... 20/08/2002 18:01:38 >>>
Steven thanks for replay,
This part is ok but my main form is to big so subform is visible only when
you click on chkBox ,than you select supplier from combobox,click on print
and subform is invisible. But if i go back to record where i select chkBox
from before the only way to make subform visible is to unselect and then
select again chkBox ...so is same another way to make this ?

-----Original Message-----
From: Steven White [mailto:Steve.White@m...]
Sent: Tuesday, August 20, 2002 7:10 AM
To: Access
Subject: [access] Re: combobox


If you copy the same Event Procedure from the checkbox to the Forms "On
Current" event, it should solve your problem.

eg. if your checkbox change, click or exit event procedure is

If chkBox = -1 then
   Subform.Visible=True
Else
   Subform.Visible=False
End If

you can copy that directyly to the Form Current event.
So for each record you go to, the visibility of the subform will be based
on whatever the checkbox value is.

Steven







  Return to Index