If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
enable/disable, show/hide checkbox help
I have a Invoice form with a line items subform. On the subform I have a
checkbox for users to select which items of the order are to be shipped. If I have the form open in 'Edit'mode users can select the check box to indicate which items they wish to ship. However, as it is in edit mode, they can also inadvertently select a checkbox for a row that does not have a record and as such the application throws an error message as it has no related record. I therefore need a method that allows me to open the form in edit mode, but does not have any blank records for the checkbox to be selected in error. On the main form I have a field txtShippmentID that by default has no value, and I require the user to create a shipment code in the first instance, so my thought was to have something in the checkbox like: Private Sub Form_Current() If Me.txtShipmentID = "" Then Me.Form!frmInvoiceLineItems.Check85.Visible = False Else Me.Form!frmInvoiceLineItems.Check85.Visible = True End If End Sub But I think I am reference the subform incorrectly as it throws an error saying it cannot find the field frmInvoiceLineItems? But even if that was to work it would still be possible for a user to select the checkbox for a blank row, so need a way I can only show the checkbox for rows with a record. Any suggestion most welcome |
#2
|
|||
|
|||
enable/disable, show/hide checkbox help
"EddWood" wrote in message
... I have a Invoice form with a line items subform. On the subform I have a checkbox for users to select which items of the order are to be shipped. If I have the form open in 'Edit'mode users can select the check box to indicate which items they wish to ship. However, as it is in edit mode, they can also inadvertently select a checkbox for a row that does not have a record and as such the application throws an error message as it has no related record. I therefore need a method that allows me to open the form in edit mode, but does not have any blank records for the checkbox to be selected in error. On the main form I have a field txtShippmentID that by default has no value, and I require the user to create a shipment code in the first instance, so my thought was to have something in the checkbox like: Private Sub Form_Current() If Me.txtShipmentID = "" Then Me.Form!frmInvoiceLineItems.Check85.Visible = False Else Me.Form!frmInvoiceLineItems.Check85.Visible = True End If End Sub But I think I am reference the subform incorrectly as it throws an error saying it cannot find the field frmInvoiceLineItems? But even if that was to work it would still be possible for a user to select the checkbox for a blank row, so need a way I can only show the checkbox for rows with a record. Any suggestion most welcome It sounds to me like all you have to do is set the Allow Additions property of the subform's source-object form to No. You can do this in the form design if the form will only ever be used as a subform in this mode. If the same form should sometimes allow additions, you can use some event of the parent form to set the property on the subform: Me.frmInvoiceLineItems.Form.AllowAdditions = False -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#3
|
|||
|
|||
enable/disable, show/hide checkbox help
"EddWood" wrote in message
... I have a Invoice form with a line items subform. On the subform I have a checkbox for users to select which items of the order are to be shipped. If I have the form open in 'Edit'mode users can select the check box to indicate which items they wish to ship. However, as it is in edit mode, they can also inadvertently select a checkbox for a row that does not have a record and as such the application throws an error message as it has no related record. I therefore need a method that allows me to open the form in edit mode, but does not have any blank records for the checkbox to be selected in error. On the main form I have a field txtShippmentID that by default has no value, and I require the user to create a shipment code in the first instance, so my thought was to have something in the checkbox like: Private Sub Form_Current() If Me.txtShipmentID = "" Then Me.Form!frmInvoiceLineItems.Check85.Visible = False Else Me.Form!frmInvoiceLineItems.Check85.Visible = True End If End Sub But I think I am reference the subform incorrectly as it throws an error saying it cannot find the field frmInvoiceLineItems? But even if that was to work it would still be possible for a user to select the checkbox for a blank row, so need a way I can only show the checkbox for rows with a record. Any suggestion most welcome It sounds to me like all you have to do is set the Allow Additions property of the subform's source-object form to No. You can do this in the form design if the form will only ever be used as a subform in this mode. If the same form should sometimes allow additions, you can use some event of the parent form to set the property on the subform: Me.frmInvoiceLineItems.Form.AllowAdditions = False -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#4
|
|||
|
|||
enable/disable, show/hide checkbox help
"EddWood" wrote in message
... I have a Invoice form with a line items subform. On the subform I have a checkbox for users to select which items of the order are to be shipped. If I have the form open in 'Edit'mode users can select the check box to indicate which items they wish to ship. However, as it is in edit mode, they can also inadvertently select a checkbox for a row that does not have a record and as such the application throws an error message as it has no related record. I therefore need a method that allows me to open the form in edit mode, but does not have any blank records for the checkbox to be selected in error. On the main form I have a field txtShippmentID that by default has no value, and I require the user to create a shipment code in the first instance, so my thought was to have something in the checkbox like: Private Sub Form_Current() If Me.txtShipmentID = "" Then Me.Form!frmInvoiceLineItems.Check85.Visible = False Else Me.Form!frmInvoiceLineItems.Check85.Visible = True End If End Sub But I think I am reference the subform incorrectly as it throws an error saying it cannot find the field frmInvoiceLineItems? But even if that was to work it would still be possible for a user to select the checkbox for a blank row, so need a way I can only show the checkbox for rows with a record. Any suggestion most welcome It sounds to me like all you have to do is set the Allow Additions property of the subform's source-object form to No. You can do this in the form design if the form will only ever be used as a subform in this mode. If the same form should sometimes allow additions, you can use some event of the parent form to set the property on the subform: Me.frmInvoiceLineItems.Form.AllowAdditions = False -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#5
|
|||
|
|||
enable/disable, show/hide checkbox help
Excellent thanks Dirk.
"Dirk Goldgar" wrote in message ... "EddWood" wrote in message ... I have a Invoice form with a line items subform. On the subform I have a checkbox for users to select which items of the order are to be shipped. If I have the form open in 'Edit'mode users can select the check box to indicate which items they wish to ship. However, as it is in edit mode, they can also inadvertently select a checkbox for a row that does not have a record and as such the application throws an error message as it has no related record. I therefore need a method that allows me to open the form in edit mode, but does not have any blank records for the checkbox to be selected in error. On the main form I have a field txtShippmentID that by default has no value, and I require the user to create a shipment code in the first instance, so my thought was to have something in the checkbox like: Private Sub Form_Current() If Me.txtShipmentID = "" Then Me.Form!frmInvoiceLineItems.Check85.Visible = False Else Me.Form!frmInvoiceLineItems.Check85.Visible = True End If End Sub But I think I am reference the subform incorrectly as it throws an error saying it cannot find the field frmInvoiceLineItems? But even if that was to work it would still be possible for a user to select the checkbox for a blank row, so need a way I can only show the checkbox for rows with a record. Any suggestion most welcome It sounds to me like all you have to do is set the Allow Additions property of the subform's source-object form to No. You can do this in the form design if the form will only ever be used as a subform in this mode. If the same form should sometimes allow additions, you can use some event of the parent form to set the property on the subform: Me.frmInvoiceLineItems.Form.AllowAdditions = False -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#6
|
|||
|
|||
enable/disable, show/hide checkbox help
Excellent thanks Dirk.
"Dirk Goldgar" wrote in message ... "EddWood" wrote in message ... I have a Invoice form with a line items subform. On the subform I have a checkbox for users to select which items of the order are to be shipped. If I have the form open in 'Edit'mode users can select the check box to indicate which items they wish to ship. However, as it is in edit mode, they can also inadvertently select a checkbox for a row that does not have a record and as such the application throws an error message as it has no related record. I therefore need a method that allows me to open the form in edit mode, but does not have any blank records for the checkbox to be selected in error. On the main form I have a field txtShippmentID that by default has no value, and I require the user to create a shipment code in the first instance, so my thought was to have something in the checkbox like: Private Sub Form_Current() If Me.txtShipmentID = "" Then Me.Form!frmInvoiceLineItems.Check85.Visible = False Else Me.Form!frmInvoiceLineItems.Check85.Visible = True End If End Sub But I think I am reference the subform incorrectly as it throws an error saying it cannot find the field frmInvoiceLineItems? But even if that was to work it would still be possible for a user to select the checkbox for a blank row, so need a way I can only show the checkbox for rows with a record. Any suggestion most welcome It sounds to me like all you have to do is set the Allow Additions property of the subform's source-object form to No. You can do this in the form design if the form will only ever be used as a subform in this mode. If the same form should sometimes allow additions, you can use some event of the parent form to set the property on the subform: Me.frmInvoiceLineItems.Form.AllowAdditions = False -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#7
|
|||
|
|||
enable/disable, show/hide checkbox help
Excellent thanks Dirk.
"Dirk Goldgar" wrote in message ... "EddWood" wrote in message ... I have a Invoice form with a line items subform. On the subform I have a checkbox for users to select which items of the order are to be shipped. If I have the form open in 'Edit'mode users can select the check box to indicate which items they wish to ship. However, as it is in edit mode, they can also inadvertently select a checkbox for a row that does not have a record and as such the application throws an error message as it has no related record. I therefore need a method that allows me to open the form in edit mode, but does not have any blank records for the checkbox to be selected in error. On the main form I have a field txtShippmentID that by default has no value, and I require the user to create a shipment code in the first instance, so my thought was to have something in the checkbox like: Private Sub Form_Current() If Me.txtShipmentID = "" Then Me.Form!frmInvoiceLineItems.Check85.Visible = False Else Me.Form!frmInvoiceLineItems.Check85.Visible = True End If End Sub But I think I am reference the subform incorrectly as it throws an error saying it cannot find the field frmInvoiceLineItems? But even if that was to work it would still be possible for a user to select the checkbox for a blank row, so need a way I can only show the checkbox for rows with a record. Any suggestion most welcome It sounds to me like all you have to do is set the Allow Additions property of the subform's source-object form to No. You can do this in the form design if the form will only ever be used as a subform in this mode. If the same form should sometimes allow additions, you can use some event of the parent form to set the property on the subform: Me.frmInvoiceLineItems.Form.AllowAdditions = False -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|