Search results

  1. andy_dyer

    Allow Edit on cmd Button Click

    I've given this a go with the following code: Private Sub cmdEdit_Click() Dim ctl As Control For Each ctl In Screen.ActiveForm If Me.AllowEdits = True Then 'Me.AllowEdits = False 'Me.AllowDeletions = False 'Me.AllowAdditions = False...
  2. andy_dyer

    Allow Edit on cmd Button Click

    Hi hiền muội, Thanks for your post - my problems are with locking the main form not the subform - the subform appears to respond to the code and locks and unlocks fine the main form is the one that unlocks and then will not lock again... :(
  3. andy_dyer

    Allow Edit on cmd Button Click

    I can't see anything... I've posted pictures of my two forms properties... the only one being called in oncurrent and this just sets some fields to be visible or not... This is sooooo frustrating... :confused:
  4. andy_dyer

    Validate form and subform on attempted exit

    Ok... I've created another query: SELECT Count(qryInvoice.[Invoice ID]) AS [Number] FROM qryInvoice WHERE (((qryInvoice.[Invoice Amount (NET)]) Is Null Or (qryInvoice.[Invoice Amount (NET)])=0)); This counts the number of nulls or 0's that i have in this field... My current vba in my main...
  5. andy_dyer

    Validate form and subform on attempted exit

    I'm not quite sure that i understand... I've got a subform based on the following query: SELECT tblInvoice.[Invoice ID], tblInvoice.[Project Number], tblInvoice.[Project Title], tblInvoice.[Planned Invoice Date], tblInvoice.[Actual Invoice Date], tblInvoice.[Invoice Number]...
  6. andy_dyer

    Allow Edit on cmd Button Click

    Really am very stuck.... anyone to take pity on me??? :rolleyes:
  7. andy_dyer

    Validate form and subform on attempted exit

    Yes it can see the field as it can make it visible and invisible (just tested that)... I think it may have something to do with the ability to check all records on the subform for the single record on the main form... is there a way of checking the field for all records on the subform and then...
  8. andy_dyer

    Allow Edit on cmd Button Click

    I have got no idea.... :( I have found so many bits of how to do this using allowedits or locked and enabled using both command and toggle buttons and nothing appears to work for me... I honestly can't understand why my original code worked for my subform but not for my main form when i was...
  9. andy_dyer

    Allow Edit on cmd Button Click

    never ever used a toggle button before but on doing a bit of research it does sound like it could be useful... my code for my toggle button is: Private Sub tglEdit_Click() If Me.tglEdit = False Then Me.AllowEdits = False Me.AllowAdditions = False...
  10. andy_dyer

    Allow Edit on cmd Button Click

    Hi, I've not managed to alter my code at all and am still a bit stuck... if anyone does have a suggestion for me to try... I'd be grateful!!
  11. andy_dyer

    Validate form and subform on attempted exit

    I'm not too sure about breakpoints or hidden controls... apart from the bits of coding I've learnt from people on this forum I'm a bit clueless... ;) I've tried to give it more code to help it close if it's ok but still nothing... If Me!Invoice.Form.Dirty And...
  12. andy_dyer

    Validate form and subform on attempted exit

    Thanks for coming back to me! The button is on frmProject with frmInvoice embedded in it... I've tried to adjust your code but still have no response from the database... :( If Me!Invoice.Form.Dirty And Nz(Me!Invoice.Form!txtInvoiceAmount, 0) = 0 Then DoCmd.OpenForm "frmError4"...
  13. andy_dyer

    Validate form and subform on attempted exit

    I'm still playing with this and my current code is this: If Me!Invoice.Form.Dirty = True And IsNull(Invoice.Form!txtInvoiceAmount) Then DoCmd.OpenForm "frmError4" Me!Invoice.Form!txtInvoiceAmount.SetFocus Exit Sub End If Still no success though... any suggestions or pointers would be...
  14. andy_dyer

    Validate form and subform on attempted exit

    Hi, I'm trying to get my database to check if fields are completed prior to exit and if not take them back to the missing fields... I've managed this on previous databases but this one is complicated with a subform... I want to check whether a field (txtInvoiceAmount) has an entry and if it is...
  15. andy_dyer

    Allow Edit on cmd Button Click

    Hi, I want to lock down my database to prevent accidental data changes... I have a command button (cmdEdit) which on click should enable edit to both my main form and sub-form and then on a second click should return the forms to read only... It works for the subform but not for the main...
  16. andy_dyer

    Working Days in a Month NOT between two dates

    It works! Thank you so much Brian and also Namliam! :D
  17. andy_dyer

    On Current for embedded forms

    Ahhh... Thank you ever so much for your help!! :)
  18. andy_dyer

    On Current for embedded forms

    I've just put that if me.newrecord code into frmInvoice as well and now it works!! I don't understand I thought that because it was embedded I would control it from the master form... Why did i need the code in the subform as well?
  19. andy_dyer

    On Current for embedded forms

    In the main form frmProject I do have the extra code in on the On Current just not on the frmInvoice: If Me!Invoice.Form.NewRecord Then Me!Invoice.Form!cmdPlanned.Visible = True Me!Invoice.Form!cmdClearPlanned.Visible = True Me!Invoice.Form![Planned Invoice Date].Visible = True...
  20. andy_dyer

    Working Days in a Month NOT between two dates

    I've just changed the "mmm" to "mm" and it gave me numbers! This then feeds through and works! Is there a way to convert the numbers 01, 02 etc back to Jan, Feb for reporting purposes? Plus also am i right that my roiginal code only excludes weekends... can it also exclude bank holidays...
Back
Top Bottom