Recent content by path479

  1. P

    Retrieve the query name for a report

    Hi Cronk. Thank you for your advice. Yes you are right I should put in more details. I have worked out the issue. The problem was that the reports!YourReportName.recordsource was invoked in a function. If I move reports!YourReportName.recordsource to the on load even of the report, it...
  2. P

    Retrieve the query name for a report

    Is it possible to retrieve the query name for a report? I am trying to create a button in a report and when the button is click, it would provide the name of the query that is behind the report (i.e. the query that is record source for the report). How do I go about in achieving this...
  3. P

    Running query in VBA with where condition

    Hi arnelgp Thank you so much. This does exactly filter what I need. However it is my fault I didn't explain very well what I am trying to do. We want to have a button on a form which when click would: - trigger the VBA code to run the query, (with the where condition or filter the...
  4. P

    Running query in VBA with where condition

    I have a query set up in Access without any criteria or parameters set. In VBA, I can use DoCmd.OpenQuery to run it. However it doesn't have the parameter to run it with where condition. Whereas DoCmd.OpenReport you can Is there any way to run the query in VBA with where condition? Or is...
  5. P

    How to avoid #Num! being displayed?

    Hi arnelgp, Thank you for your suggestion. Unfortunately "=Nz([txtPrimaryWkpt_area], 0) /Nz([txtNLA], 1)"does seem to work. I ended up using the following =IIf([txtNLA]=0,0,[txtPrimaryWkpt_area]/[txtNLA])
  6. P

    Is it possible to have one form but different SQLs to load data?

    Is it possible to have a form that would use different SQL statements to load its data depending on which button the user is used to invoke the form? If so, how to achieve this? I have a form that is used for entering data to the table “Project”. It is also used to display existing data from...
  7. P

    How to avoid #Num! being displayed?

    I have a text box and its control source is an expression as follow: =[txtPrimaryWkpt_area]/[txtNLA] When the value is Null, it is displaying "#Num!" I have tried adding Nz around the expression to become =Nz([txtPrimaryWkpt_area]/[txtNLA], 0) However it makes no differences...
  8. P

    VBA function with nested UPDATE SQL

    Thank you arnelgp and MarkK. Both your suggestions works great. Arnelgp. Thank you for suggesting on using DSum. I had tried it before but didn't work. I now realised I got the proj_id field wrong. MarkK, you are right. I should avoid updating the parent with calculation on child...
  9. P

    VBA function with nested UPDATE SQL

    When I ran the following function I got the error message “Operation must use an updateable query.”: Public Function UpdProjNLA() NLA_SQL = _ "UPDATE Project " & _ "SET Project.projNLA_area = " & _ "(SELECT Sum(Floor.formalVSml_no * Floor.nla) " & _ "FROM Floor...
  10. P

    How should macro call VBA function and test the return value?

    Thank you arnelgp. Got it working! Thank you again
  11. P

    How should macro call VBA function and test the return value?

    Hi Ranman256. Thank you for responding. Seems like you were going to include some links or codes that might have been left out. Would you be able to provide those information please? Thank you.
  12. P

    How should macro call VBA function and test the return value?

    I have a button with embedded marco (using macro builder). The macro carries out a series of actions/command. One of actions is to call a vba function. The intention is for this vba function to return a value back to the macro which will then carry a series of action based on the returned...
  13. P

    How to stop update to database when moving among tabs in TabControl

    Thank you Uncle_Gizmo. The link and the sample database are very helpful!
  14. P

    How to stop update to database when moving among tabs in TabControl

    Hi CJ_London. Thank you for the all advice. I am inclining to leave the subform as is for now and, if time permits, I will look into making it unbound. Is there anyway to have a messagebox whenever users click the 2nd tab so to let them know changes made in the other tabs have been saved...
  15. P

    How to stop update to database when moving among tabs in TabControl

    Yes the second tab has a subform.
Back
Top Bottom