Search results

  1. L

    Dlookup not returning any results

    thank you! worked
  2. L

    Dlookup not returning any results

    Here is my VBA Dlookup Code: Public Sub test() Dim frm As Form Set frm = Forms!StationLevelSummary i = Nz(DLookup(" [tblPaxAtStationLevel]![number_of_days]", "tblPaxAtStationLevel", _ "[tblPaxAtStationLevel]![Time_Band] = '" & frm.txtbox_am & "' " & _ " And...
  3. L

    Run Event Code Of Another Form

    dlamarche I know the post is old, but THANK YOU SO MUCH!!! I tried everything and completely forgot about private/public scopes.
  4. L

    Unable to call Event from Module

    thanks for that. I've changes the sub from private to public, but now I get this error: The expression you entered as a query parameter produce this error: '[txtbox_pream]' txtbox_pream is a text box on the form whose value I pass as a parameter. But again, if I run the code from a button, I...
  5. L

    Unable to call Event from Module

    This is the code I'm trying to run from a Standard Module: Public Sub RunPaxCalculations() Dim frm As Form Dim intNumberOfRecordsInFilter Dim i As Integer Set frm = Forms!vr_selection 'intNumberOfRecordsInFilter = frm.filter_entrance.ListCount intNumberOfRecordsInFilter = 5 + 1 'Debug.Print...
  6. L

    What is a standard way of declaring constants?

    thanks for that. I don't think I understand how the global variable works. So I understand that you can declare it once for the whole project, for example Public strABC as string. How I can use this variable everywhere without declaring it again. But if I set it as something, for example...
  7. L

    How to force a combo box trigger to fire

    Ok I worked it out. For anyone who may need it, all you do is go: Call name_of_sub_Change
  8. L

    How to force a combo box trigger to fire

    I have about 4 combo boxes with a list value of dates in them, combo1 is the 'main control'. When a date from combo1 is chosen and a button is clicked, the other 3 combo boxes receive a default value that closely matches combo1. In fact the default value each of the 3 combo boxes receive exists...
  9. L

    What is a standard way of declaring constants?

    thanks. no they are not. I have a few strings that I want to use throughout the project and I want to set up the connection string there as well. I connect to SQL server many times and at the moment i keep on repeating the code on each connection. It gets tedious when I need to make a small...
  10. L

    What is a standard way of declaring constants?

    I know that a public constant is available to all subs and modules (hope thats right). I also know that you can only declare these in a module, you can't for example declare these in the form. So how what is the best way of declaring them? At the moment I just have a module that has nothing else...
  11. L

    query returns Chinese charters when selecting a value from a text box

    When Im selecting a value from a texbox, and the value is a number, my query returns chinese characters. But when I run the same query for a text box that contains text, I get the correct text. This is the query I run which gives me chinese characters: SELECT...
  12. L

    How to refresh a chart in a sub-from

    I have a form and a sub-form. the form contains a button and the sub-form contains a chart. When the button is clicked on the main form a table gets recreated in the background, the table has some data that should be used in the chart. How do I refresh the chart in the sub-form so that it uses...
  13. L

    Operation is not allowed when the object is closed.

    I though about that but that code works for another identical SP, except for one column. I finally fixed it by adding SET NOCOUNT ON in my SP. I have no idea why it worked. If anyone could please explain why this addition makes a difference to VBA that would be great. I've seen this solution in...
  14. L

    Operation is not allowed when the object is closed.

    I keep on getting this error. I cant figure out why!? the weird part is that I have exactly the same stored procedure but insted of FinancialYear it has a calendar year. So instead of of having something like '2013', it has 'FY2012 - 2013'. The calendar year SP works perfectly, but this does...
  15. L

    Accessing form objects from Modul

    I have no idea why, but it suddenly worked!
  16. L

    Accessing form objects from Modul

    I have a SQL Server stored procedure created in a module. I want one of the parameters to come from a combo box in one of the forms. But I can't seem to get access to the form. When ever I type if Forms!Myform. I dont get any drop down options from VBA. Here is a small part of my code: Set...
Back
Top Bottom