subform checkbox visible

E

EddWood

I have a checkbox in my subform which is set to not visible and only want it
visible once a value is in my main form txtShipmentID box has a value in.
txtShipmentID is an unbound control.

I have tried this code below but I recon I am not referencing the Checkbox
correctly??

Private Sub txtShipmentID_AfterUpdate()
Me.Form.frmInvoice.Forms.frmInvoiceLineItems.Check85.Visible = True
End Sub
 
G

Gina Whipp

EddWood,

Try...

Private Sub txtShipmentID_AfterUpdate()

If Me.txtShipmentID > 0 Then
[frmInvoice].Form![frmInvoiceLineItems].Visible = True
Else
[frmInvoice].Form![frmInvoiceLineItems].Visible = False
End If
End Sub

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
L

Lynn Trapp

First of all, you should give your checkbox a more meaningful name, like
chkIsValid or some other such name that describes what it does. Then do the
following in the after update event of your textbox:

If IsNull(Me.txtShipmentID) then
me.chkIsValid.Visible = False
Else
Me.chkIsValid.Visible = True
End If

Also, add the same code to the Current event of your form.
 
G

Gina Whipp

Fingers not cooperating with brain!!!

Private Sub txtShipmentID_AfterUpdate()

If Me.txtShipmentID > 0 Then
[frmInvoiceLineItems].Form![Check85].Visible = True
Else
[frmInvoiceLineItems].Form![Check85].Visible = False
End If
End Sub


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Gina Whipp said:
EddWood,

Try...

Private Sub txtShipmentID_AfterUpdate()

If Me.txtShipmentID > 0 Then
[frmInvoice].Form![frmInvoiceLineItems].Visible = True
Else
[frmInvoice].Form![frmInvoiceLineItems].Visible = False
End If
End Sub

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
I have a checkbox in my subform which is set to not visible and only want
it visible once a value is in my main form txtShipmentID box has a value
in. txtShipmentID is an unbound control.

I have tried this code below but I recon I am not referencing the
Checkbox correctly??

Private Sub txtShipmentID_AfterUpdate()
Me.Form.frmInvoice.Forms.frmInvoiceLineItems.Check85.Visible = True
End Sub
 
E

EddWood

Hi Guys,

Many thanks for those suggestions, unfortunatly neither of these options
work, or using a combination of either, i.e. using 'if is null' rather than
'if txtShipmentID > 0 Then' and even 'if txtShipmentID = "" Then'

To confirm Lynn the name will be changed once I have got the event working
correctly. just the way I work.

Thanks
Edd
 
E

EddWood

Hi Gina,

I have a form that creates a shipping code and applies the code to this
field when that form closes:

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
DoCmd.Close
End Sub

The field type is a text field.

I want to ensure that a user has created a shipping code BEFORE they can
select the items they wish to ship first, hence Once I have a value I want
the select checkbox to be visible but not before.

Regards
 
G

Gina Whipp

Edd,

Well, that would explain why it's not working... Think about it, it sounds
like you are telling the form to...

Click cmdClose...
....and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire because
the form closed. You would need to place the code where indicated above in
order for it have a chance to fire. Is that button on the Parent form or
the Subform? It may have to be adjusted accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
E

EddWood

The on-close event is on a separate form. So I assume what you are saying is
that we add this event to this on-close event to make the checkbox visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards
 
G

Gina Whipp

Edd,

Your assumption is correct.

For how to Refer to Controls see...

http://www.mvps.org/access/forms/frm0031.htm

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
The on-close event is on a separate form. So I assume what you are saying
is that we add this event to this on-close event to make the checkbox
visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards


Gina Whipp said:
Edd,

Well, that would explain why it's not working... Think about it, it
sounds like you are telling the form to...

Click cmdClose...
...and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire because
the form closed. You would need to place the code where indicated above
in order for it have a chance to fire. Is that button on the Parent form
or the Subform? It may have to be adjusted accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm
 
E

EddWood

I have tried this behind the close form button of frmShipment :

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
Forms!frmInvoice!frmInvoiceLineItems.Form!frmInvoiceLineItems.Form!ChkSelect.Visible
= True
DoCmd.Close
End Sub

But keep getting the following error

Can't find the field 'frmInvoiceLineItems' referred to in your expression

So again I appear to be referencing the control wrong

PS have changed the checkbox control to ChkSelect


EddWood said:
The on-close event is on a separate form. So I assume what you are saying
is that we add this event to this on-close event to make the checkbox
visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards


Gina Whipp said:
Edd,

Well, that would explain why it's not working... Think about it, it
sounds like you are telling the form to...

Click cmdClose...
...and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire because
the form closed. You would need to place the code where indicated above
in order for it have a chance to fire. Is that button on the Parent form
or the Subform? It may have to be adjusted accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm
 
E

EddWood

Hi Gina,

Ironically, I have been using that page as a guide !!


Gina Whipp said:
Edd,

Your assumption is correct.

For how to Refer to Controls see...

http://www.mvps.org/access/forms/frm0031.htm

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
The on-close event is on a separate form. So I assume what you are saying
is that we add this event to this on-close event to make the checkbox
visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards


Gina Whipp said:
Edd,

Well, that would explain why it's not working... Think about it, it
sounds like you are telling the form to...

Click cmdClose...
...and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire
because the form closed. You would need to place the code where
indicated above in order for it have a chance to fire. Is that button
on the Parent form or the Subform? It may have to be adjusted
accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Gina,

I have a form that creates a shipping code and applies the code to this
field when that form closes:

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
DoCmd.Close
End Sub

The field type is a text field.

I want to ensure that a user has created a shipping code BEFORE they
can select the items they wish to ship first, hence Once I have a value
I want the select checkbox to be visible but not before.

Regards


Edd,

How exactly does the field get updated and what is the data type?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Guys,

Many thanks for those suggestions, unfortunatly neither of these
options work, or using a combination of either, i.e. using 'if is
null' rather than 'if txtShipmentID > 0 Then' and even 'if
txtShipmentID = "" Then'

To confirm Lynn the name will be changed once I have got the event
working correctly. just the way I work.

Thanks
Edd

First of all, you should give your checkbox a more meaningful name,
like
chkIsValid or some other such name that describes what it does. Then
do the
following in the after update event of your textbox:

If IsNull(Me.txtShipmentID) then
me.chkIsValid.Visible = False
Else
Me.chkIsValid.Visible = True
End If

Also, add the same code to the Current event of your form.

--
Lynn Trapp
(e-mail address removed)


:

I have a checkbox in my subform which is set to not visible and
only want it
visible once a value is in my main form txtShipmentID box has a
value in.
txtShipmentID is an unbound control.

I have tried this code below but I recon I am not referencing the
Checkbox
correctly??

Private Sub txtShipmentID_AfterUpdate()
Me.Form.frmInvoice.Forms.frmInvoiceLineItems.Check85.Visible = True
End Sub
 
G

Gina Whipp

Edd,

Can you send me the database? Does it have data in it?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
I have tried this behind the close form button of frmShipment :

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
Forms!frmInvoice!frmInvoiceLineItems.Form!frmInvoiceLineItems.Form!ChkSelect.Visible
= True
DoCmd.Close
End Sub

But keep getting the following error

Can't find the field 'frmInvoiceLineItems' referred to in your expression

So again I appear to be referencing the control wrong

PS have changed the checkbox control to ChkSelect


EddWood said:
The on-close event is on a separate form. So I assume what you are saying
is that we add this event to this on-close event to make the checkbox
visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards


Gina Whipp said:
Edd,

Well, that would explain why it's not working... Think about it, it
sounds like you are telling the form to...

Click cmdClose...
...and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire
because the form closed. You would need to place the code where
indicated above in order for it have a chance to fire. Is that button
on the Parent form or the Subform? It may have to be adjusted
accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Gina,

I have a form that creates a shipping code and applies the code to this
field when that form closes:

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
DoCmd.Close
End Sub

The field type is a text field.

I want to ensure that a user has created a shipping code BEFORE they
can select the items they wish to ship first, hence Once I have a value
I want the select checkbox to be visible but not before.

Regards


Edd,

How exactly does the field get updated and what is the data type?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Guys,

Many thanks for those suggestions, unfortunatly neither of these
options work, or using a combination of either, i.e. using 'if is
null' rather than 'if txtShipmentID > 0 Then' and even 'if
txtShipmentID = "" Then'

To confirm Lynn the name will be changed once I have got the event
working correctly. just the way I work.

Thanks
Edd

First of all, you should give your checkbox a more meaningful name,
like
chkIsValid or some other such name that describes what it does. Then
do the
following in the after update event of your textbox:

If IsNull(Me.txtShipmentID) then
me.chkIsValid.Visible = False
Else
Me.chkIsValid.Visible = True
End If

Also, add the same code to the Current event of your form.

--
Lynn Trapp
(e-mail address removed)


:

I have a checkbox in my subform which is set to not visible and
only want it
visible once a value is in my main form txtShipmentID box has a
value in.
txtShipmentID is an unbound control.

I have tried this code below but I recon I am not referencing the
Checkbox
correctly??

Private Sub txtShipmentID_AfterUpdate()
Me.Form.frmInvoice.Forms.frmInvoiceLineItems.Check85.Visible = True
End Sub
 
E

EddWood

Can't as it connect to SQL backend DB.

Will keep trying the various combinations to see if I can sort it.

Kindest regards
Edd

Gina Whipp said:
Edd,

Can you send me the database? Does it have data in it?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
I have tried this behind the close form button of frmShipment :

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
Forms!frmInvoice!frmInvoiceLineItems.Form!frmInvoiceLineItems.Form!ChkSelect.Visible
= True
DoCmd.Close
End Sub

But keep getting the following error

Can't find the field 'frmInvoiceLineItems' referred to in your expression

So again I appear to be referencing the control wrong

PS have changed the checkbox control to ChkSelect


EddWood said:
The on-close event is on a separate form. So I assume what you are
saying is that we add this event to this on-close event to make the
checkbox visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards


Edd,

Well, that would explain why it's not working... Think about it, it
sounds like you are telling the form to...

Click cmdClose...
...and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire
because the form closed. You would need to place the code where
indicated above in order for it have a chance to fire. Is that button
on the Parent form or the Subform? It may have to be adjusted
accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Gina,

I have a form that creates a shipping code and applies the code to
this field when that form closes:

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
DoCmd.Close
End Sub

The field type is a text field.

I want to ensure that a user has created a shipping code BEFORE they
can select the items they wish to ship first, hence Once I have a
value I want the select checkbox to be visible but not before.

Regards


Edd,

How exactly does the field get updated and what is the data type?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Guys,

Many thanks for those suggestions, unfortunatly neither of these
options work, or using a combination of either, i.e. using 'if is
null' rather than 'if txtShipmentID > 0 Then' and even 'if
txtShipmentID = "" Then'

To confirm Lynn the name will be changed once I have got the event
working correctly. just the way I work.

Thanks
Edd

First of all, you should give your checkbox a more meaningful name,
like
chkIsValid or some other such name that describes what it does.
Then do the
following in the after update event of your textbox:

If IsNull(Me.txtShipmentID) then
me.chkIsValid.Visible = False
Else
Me.chkIsValid.Visible = True
End If

Also, add the same code to the Current event of your form.

--
Lynn Trapp
(e-mail address removed)


:

I have a checkbox in my subform which is set to not visible and
only want it
visible once a value is in my main form txtShipmentID box has a
value in.
txtShipmentID is an unbound control.

I have tried this code below but I recon I am not referencing the
Checkbox
correctly??

Private Sub txtShipmentID_AfterUpdate()
Me.Form.frmInvoice.Forms.frmInvoiceLineItems.Check85.Visible =
True
End Sub
 
G

Gina Whipp

Edd,

Okay I can tell you steps to get the correct path.... hold on and I will
type them in my next post!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
Can't as it connect to SQL backend DB.

Will keep trying the various combinations to see if I can sort it.

Kindest regards
Edd

Gina Whipp said:
Edd,

Can you send me the database? Does it have data in it?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
I have tried this behind the close form button of frmShipment :

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
Forms!frmInvoice!frmInvoiceLineItems.Form!frmInvoiceLineItems.Form!ChkSelect.Visible
= True
DoCmd.Close
End Sub

But keep getting the following error

Can't find the field 'frmInvoiceLineItems' referred to in your
expression

So again I appear to be referencing the control wrong

PS have changed the checkbox control to ChkSelect


The on-close event is on a separate form. So I assume what you are
saying is that we add this event to this on-close event to make the
checkbox visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards


Edd,

Well, that would explain why it's not working... Think about it, it
sounds like you are telling the form to...

Click cmdClose...
...and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire
because the form closed. You would need to place the code where
indicated above in order for it have a chance to fire. Is that button
on the Parent form or the Subform? It may have to be adjusted
accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Gina,

I have a form that creates a shipping code and applies the code to
this field when that form closes:

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
DoCmd.Close
End Sub

The field type is a text field.

I want to ensure that a user has created a shipping code BEFORE they
can select the items they wish to ship first, hence Once I have a
value I want the select checkbox to be visible but not before.

Regards


Edd,

How exactly does the field get updated and what is the data type?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Guys,

Many thanks for those suggestions, unfortunatly neither of these
options work, or using a combination of either, i.e. using 'if is
null' rather than 'if txtShipmentID > 0 Then' and even 'if
txtShipmentID = "" Then'

To confirm Lynn the name will be changed once I have got the event
working correctly. just the way I work.

Thanks
Edd

First of all, you should give your checkbox a more meaningful
name, like
chkIsValid or some other such name that describes what it does.
Then do the
following in the after update event of your textbox:

If IsNull(Me.txtShipmentID) then
me.chkIsValid.Visible = False
Else
Me.chkIsValid.Visible = True
End If

Also, add the same code to the Current event of your form.

--
Lynn Trapp
(e-mail address removed)


:

I have a checkbox in my subform which is set to not visible and
only want it
visible once a value is in my main form txtShipmentID box has a
value in.
txtShipmentID is an unbound control.

I have tried this code below but I recon I am not referencing the
Checkbox
correctly??

Private Sub txtShipmentID_AfterUpdate()
Me.Form.frmInvoice.Forms.frmInvoiceLineItems.Check85.Visible =
True
End Sub
 
G

Gina Whipp

Edd,

1. Open the form that has the target control, either in Form View or Design
View
2. Open the form that has the Command Button in Design View
2a. Put a Text Box on the Form next to the Command Button
2b. In the Properties Window of the Text Box click the Ellipse Button
[...]
2c. In the Window that opens on the Left Window on the second row,
double click on Forms - then double click on Loaded Forms. Navigate, in
that folder, to the form that has the target control.
2d. From the center window find the control and double click. You
should see the path in wide box at the top of that window.
2e. Copy that then Cancel out of that and go the Command Button and
select the Ellipse button [...] and Paste.

That should give you the path you need to get to that control.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
Can't as it connect to SQL backend DB.

Will keep trying the various combinations to see if I can sort it.

Kindest regards
Edd

Gina Whipp said:
Edd,

Can you send me the database? Does it have data in it?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
I have tried this behind the close form button of frmShipment :

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
Forms!frmInvoice!frmInvoiceLineItems.Form!frmInvoiceLineItems.Form!ChkSelect.Visible
= True
DoCmd.Close
End Sub

But keep getting the following error

Can't find the field 'frmInvoiceLineItems' referred to in your
expression

So again I appear to be referencing the control wrong

PS have changed the checkbox control to ChkSelect


The on-close event is on a separate form. So I assume what you are
saying is that we add this event to this on-close event to make the
checkbox visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards


Edd,

Well, that would explain why it's not working... Think about it, it
sounds like you are telling the form to...

Click cmdClose...
...and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire
because the form closed. You would need to place the code where
indicated above in order for it have a chance to fire. Is that button
on the Parent form or the Subform? It may have to be adjusted
accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Gina,

I have a form that creates a shipping code and applies the code to
this field when that form closes:

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
DoCmd.Close
End Sub

The field type is a text field.

I want to ensure that a user has created a shipping code BEFORE they
can select the items they wish to ship first, hence Once I have a
value I want the select checkbox to be visible but not before.

Regards


Edd,

How exactly does the field get updated and what is the data type?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Guys,

Many thanks for those suggestions, unfortunatly neither of these
options work, or using a combination of either, i.e. using 'if is
null' rather than 'if txtShipmentID > 0 Then' and even 'if
txtShipmentID = "" Then'

To confirm Lynn the name will be changed once I have got the event
working correctly. just the way I work.

Thanks
Edd

First of all, you should give your checkbox a more meaningful
name, like
chkIsValid or some other such name that describes what it does.
Then do the
following in the after update event of your textbox:

If IsNull(Me.txtShipmentID) then
me.chkIsValid.Visible = False
Else
Me.chkIsValid.Visible = True
End If

Also, add the same code to the Current event of your form.

--
Lynn Trapp
(e-mail address removed)


:

I have a checkbox in my subform which is set to not visible and
only want it
visible once a value is in my main form txtShipmentID box has a
value in.
txtShipmentID is an unbound control.

I have tried this code below but I recon I am not referencing the
Checkbox
correctly??

Private Sub txtShipmentID_AfterUpdate()
Me.Form.frmInvoice.Forms.frmInvoiceLineItems.Check85.Visible =
True
End Sub
 
E

EddWood

Hey Gina,

Dohh... why did I not think of doing that!!

Got it sorted now, many thanks for your help and time

Anyone else following this post, this is what it should have been :

Forms![frmInvoice]![frmInvoiceLineItems].Form![ChkSelect].Visible = True

Regards
Edd


Gina Whipp said:
Edd,

1. Open the form that has the target control, either in Form View or
Design View
2. Open the form that has the Command Button in Design View
2a. Put a Text Box on the Form next to the Command Button
2b. In the Properties Window of the Text Box click the Ellipse Button
[...]
2c. In the Window that opens on the Left Window on the second row,
double click on Forms - then double click on Loaded Forms. Navigate, in
that folder, to the form that has the target control.
2d. From the center window find the control and double click. You
should see the path in wide box at the top of that window.
2e. Copy that then Cancel out of that and go the Command Button and
select the Ellipse button [...] and Paste.

That should give you the path you need to get to that control.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
Can't as it connect to SQL backend DB.

Will keep trying the various combinations to see if I can sort it.

Kindest regards
Edd

Gina Whipp said:
Edd,

Can you send me the database? Does it have data in it?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

I have tried this behind the close form button of frmShipment :

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
Forms!frmInvoice!frmInvoiceLineItems.Form!frmInvoiceLineItems.Form!ChkSelect.Visible
= True
DoCmd.Close
End Sub

But keep getting the following error

Can't find the field 'frmInvoiceLineItems' referred to in your
expression

So again I appear to be referencing the control wrong

PS have changed the checkbox control to ChkSelect


The on-close event is on a separate form. So I assume what you are
saying is that we add this event to this on-close event to make the
checkbox visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards


Edd,

Well, that would explain why it's not working... Think about it, it
sounds like you are telling the form to...

Click cmdClose...
...and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire
because the form closed. You would need to place the code where
indicated above in order for it have a chance to fire. Is that
button on the Parent form or the Subform? It may have to be adjusted
accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Gina,

I have a form that creates a shipping code and applies the code to
this field when that form closes:

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
DoCmd.Close
End Sub

The field type is a text field.

I want to ensure that a user has created a shipping code BEFORE they
can select the items they wish to ship first, hence Once I have a
value I want the select checkbox to be visible but not before.

Regards


Edd,

How exactly does the field get updated and what is the data type?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Guys,

Many thanks for those suggestions, unfortunatly neither of these
options work, or using a combination of either, i.e. using 'if is
null' rather than 'if txtShipmentID > 0 Then' and even 'if
txtShipmentID = "" Then'

To confirm Lynn the name will be changed once I have got the event
working correctly. just the way I work.

Thanks
Edd

First of all, you should give your checkbox a more meaningful
name, like
chkIsValid or some other such name that describes what it does.
Then do the
following in the after update event of your textbox:

If IsNull(Me.txtShipmentID) then
me.chkIsValid.Visible = False
Else
Me.chkIsValid.Visible = True
End If

Also, add the same code to the Current event of your form.

--
Lynn Trapp
(e-mail address removed)


:

I have a checkbox in my subform which is set to not visible and
only want it
visible once a value is in my main form txtShipmentID box has a
value in.
txtShipmentID is an unbound control.

I have tried this code below but I recon I am not referencing
the Checkbox
correctly??

Private Sub txtShipmentID_AfterUpdate()
Me.Form.frmInvoice.Forms.frmInvoiceLineItems.Check85.Visible =
True
End Sub
 
G

Gina Whipp

Edd,

Glad we got it sorted out and thanks for posting what you ended up with!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
Hey Gina,

Dohh... why did I not think of doing that!!

Got it sorted now, many thanks for your help and time

Anyone else following this post, this is what it should have been :

Forms![frmInvoice]![frmInvoiceLineItems].Form![ChkSelect].Visible = True

Regards
Edd


Gina Whipp said:
Edd,

1. Open the form that has the target control, either in Form View or
Design View
2. Open the form that has the Command Button in Design View
2a. Put a Text Box on the Form next to the Command Button
2b. In the Properties Window of the Text Box click the Ellipse Button
[...]
2c. In the Window that opens on the Left Window on the second row,
double click on Forms - then double click on Loaded Forms. Navigate, in
that folder, to the form that has the target control.
2d. From the center window find the control and double click. You
should see the path in wide box at the top of that window.
2e. Copy that then Cancel out of that and go the Command Button and
select the Ellipse button [...] and Paste.

That should give you the path you need to get to that control.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

EddWood said:
Can't as it connect to SQL backend DB.

Will keep trying the various combinations to see if I can sort it.

Kindest regards
Edd

Edd,

Can you send me the database? Does it have data in it?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

I have tried this behind the close form button of frmShipment :

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
Forms!frmInvoice!frmInvoiceLineItems.Form!frmInvoiceLineItems.Form!ChkSelect.Visible
= True
DoCmd.Close
End Sub

But keep getting the following error

Can't find the field 'frmInvoiceLineItems' referred to in your
expression

So again I appear to be referencing the control wrong

PS have changed the checkbox control to ChkSelect


The on-close event is on a separate form. So I assume what you are
saying is that we add this event to this on-close event to make the
checkbox visible?

My issue also seems on how to construct the target:

Form![frmInvoice]![frmInvoiceLineItems].Form![Check85].Visible = True

Or is it:

Form![frmInvoiceLineItems].Form![Check85].Visible = True

Regards


Edd,

Well, that would explain why it's not working... Think about it, it
sounds like you are telling the form to...

Click cmdClose...
...and right before you close...
...do this Forms!frmInvoice!txtShipmentID = invoiceID & "-" &
shipmentcode...
***PLACE CODE HERE - See paragraph below***
...then Close the form

The After_Update eent of txtShipmentID never has a chance to fire
because the form closed. You would need to place the code where
indicated above in order for it have a chance to fire. Is that
button on the Parent form or the Subform? It may have to be
adjusted accordingly.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Gina,

I have a form that creates a shipping code and applies the code to
this field when that form closes:

Private Sub CmdClose_Click()
Forms!frmInvoice!txtShipmentID = invoiceID & "-" & shipmentcode
DoCmd.Close
End Sub

The field type is a text field.

I want to ensure that a user has created a shipping code BEFORE
they can select the items they wish to ship first, hence Once I
have a value I want the select checkbox to be visible but not
before.

Regards


Edd,

How exactly does the field get updated and what is the data type?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

Hi Guys,

Many thanks for those suggestions, unfortunatly neither of these
options work, or using a combination of either, i.e. using 'if is
null' rather than 'if txtShipmentID > 0 Then' and even 'if
txtShipmentID = "" Then'

To confirm Lynn the name will be changed once I have got the
event working correctly. just the way I work.

Thanks
Edd

message
First of all, you should give your checkbox a more meaningful
name, like
chkIsValid or some other such name that describes what it does.
Then do the
following in the after update event of your textbox:

If IsNull(Me.txtShipmentID) then
me.chkIsValid.Visible = False
Else
Me.chkIsValid.Visible = True
End If

Also, add the same code to the Current event of your form.

--
Lynn Trapp
(e-mail address removed)


:

I have a checkbox in my subform which is set to not visible and
only want it
visible once a value is in my main form txtShipmentID box has a
value in.
txtShipmentID is an unbound control.

I have tried this code below but I recon I am not referencing
the Checkbox
correctly??

Private Sub txtShipmentID_AfterUpdate()
Me.Form.frmInvoice.Forms.frmInvoiceLineItems.Check85.Visible =
True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top