Recent content by nigelh

  1. N

    Calculation in Form using field in Table

    My sincerest of apologies. James your first solution was correct. The code had a space between 'cost & (£)' the field does not. All working now. Thanks James & VBA for your help.
  2. N

    Calculation in Form using field in Table

    Same error without the txtCPU which certainly suggests a problem with the field names.
  3. N

    Calculation in Form using field in Table

    Thanks for your thoughts on this. James is correct in that I am getting #Name? error still. VBA, Unit Cost(£) and Type are both fields in tblPriceList and Memory only appears in Type once, i.e the unit cost is already held against the type. Regards, Nigel
  4. N

    Calculation in Form using field in Table

    Hi James, =[txtCPU]*DLookUp("[Unit Cost (£)]","[tblPriceList]","[Type]='IntelMemory'") Same result. Nigel
  5. N

    Calculation in Form using field in Table

    Thanks for reply James, I was thinking along those lines but presumed I was getting the syntax incorrect. I have entered the following in the control source of txtCalc:- =[txtCPU]*DLookUp("[Unit Cost (£)]","tblPriceList","Type='IntelMemory'") This results in #Name? appearing in the txtCalc...
  6. N

    Calculation in Form using field in Table

    Hi All, Coming back to access after a long break and I'm sure this is a simple one. I have a table (tblPriceList) and a form (frmPriceCalc), the form is used to calculate prices. I need to perorm the following calculation:- txtCPU * [tblPriceList.Unit Cost(£)] where type = Memory At the...
  7. N

    Date a record was last updated

    Does Access keep a history of when a record was last updated, and if so can I perform a query on this value. Cheers, Nigel
  8. N

    Export to .csv Losing leading zeros

    Hi, I'm exporting a table to a .csv file. The table contains phone numbers with a data type of 'text'. When I look at the csv file strange things are happening e.g Phone number 08705329877 appears as 8.7E+09 if I expand the width of the field in the csv it changes to 8705329877 (miising the...
  9. N

    Data type mismatch 3464

    Thanks Harry.
  10. N

    Data type mismatch 3464

    I've seen a few posts when searching on this but none which solve my problem. Private Sub Combo0_Change() Dim db As DAO.Database Dim rs As DAO.Recordset Dim emp Long emp = Me!Combo0.Value Set db = CurrentDb Debug.Print emp Set rs = db.OpenRecordset( _ "select daystaken from tblholstaken where...
  11. N

    A simple one on TAB I hope

    Ta very much
  12. N

    A simple one on TAB I hope

    I have a form which has three command buttons. cmdSaveAndExit, cmdExitNoSave, cmdClear. These are the last three controls in the forms tab order. How do I prevent the user from using tabbing right through these controls to a new record. Any help would be appreciated.
  13. N

    CAN THIS VBA BE SIMPLIFIED

    Thanks Robert, I've substituted my code with your example and it works fine.
  14. N

    CAN THIS VBA BE SIMPLIFIED

    I am fairly new to VBA and would like to know if the following code could be simplified using arrays. The code fires on the click action of a SAVE command button. It is checking that all fields have been completed. Any help would be appreciated. Private Sub cmdSaveExit_Click() 'Declare...
  15. N

    Locking a form if the record has been "signed off"

    This is the first time I've offered a solution rather than posting a question, hope its relevant and helps you:- Private Sub Form_Current() If Me![Combo23] = "Closed" Then Me.AllowEdits = False Me.Detail.BackColor = 10092543 End If You would obviously replace the condition with your own. This...
Back
Top Bottom