Search results

  1. MarkK

    Select from which date as a variable vba access

    To handle all embedded delimiters and date formats without cobbling together your SQL in code, I strongly recommend an approach more like this... Const SQL_SELECT As String = _ "SELECT * FROM DATA_CHECK_KLW_2024 " & _ "WHERE Year = pYear " & _ "AND Number =...
  2. MarkK

    Britain is Changing with Freedom at Risk

    It is also evangelical about the Earth being a sphere. Apparently they have "evidence," but there should be more balanced debate on this topic, because step out your front door and look around: It is F&*%ing flat.
  3. MarkK

    Is it possible: Query/SQL to dynamically display a record/order/position number, without underlying field from a table

    For those iterating over recordset rows to find rank, you might like the Recordset.AbsolutePosition property. This property is read/write. See also PercentPosition.
  4. MarkK

    Unique values

    Another approach is to enforce logic using classes rather than database constraints. In some cases, like this, where database constraints are not well suited to a problem, it is sometimes easier to just read all your data into classes that enforce the logic themselves. Iterating over a...
  5. MarkK

    Solved Continuous Sub-Form

    Describe the actual problem, for instance... • you take action A • you observe outcome B • outcome B is not acceptable because of criteria C Using a pattern like that to describe a problem will improve your luck.
  6. MarkK

    Crash on breakpoint

    With Compile on Demand enabled, the compiler is optimized for performance in two key ways: 1) It will only compile code on the current execution path. 2) It will preserve previously compiled code. As I understand it, this can lead to crashes because you might edit the signature of procedure...
  7. MarkK

    Crash on breakpoint

    If you post the database, I'll rebuild it. I wrote code to export each object to text file, and read it back into a new database file, so it is pretty fast. Also, I edit running code all the time. Maybe it's a no-no, but if you clear the compiler settings indicated below, you dramatically...
  8. MarkK

    Solved DAO Workspace Database Collection

    Do this in the immediate pane... ? CurrentDb Is CurrentDb False CurrentDb returns a different instance on each reference. This is an advantage because a DAO.Database maintains state. If ConsumerA runs a query, the Database.RecordsAffected() property returns how many rows were affected. If...
  9. MarkK

    timerinterval

    Can you post a demo of this? Does it break into the debugger? I have never seen VBA code just stop.
  10. MarkK

    timerinterval

    Setting Me.TimerInterval to zero disables the timer. The Form_Timer() event handler will never execute while Me.TimerInterval = 0. In addition, if you set Me.TimerInterval to x, and then before x has expired you set it to x again, you effectively delay the execution of the OnTimer event...
  11. MarkK

    Command button not responding to double click

    I would use a CheckBox, like... Private Sub chkIsDesc_Click() setIndex End Sub Private Sub setIndex() Me.OrderBy = "Spec_raw" & IIf(Me.chkIsDesc, " Desc", "") End Sub I think a double-click on a command button is an unexpected behaviour.
  12. MarkK

    Tooltip with textbox when hovering over label

    You can also take a look at post #7 in this thread. I posted a sample Db that shows how you can use a form as a popup.
  13. MarkK

    Design/Structure Ideas for Data Entry form with multiple levels

    If your tables are not sufficient to model the problem accurately, then it is too soon to design data entry.
  14. MarkK

    Having a brain cramp

    I don't fully understand your problem, but looking at the code, it might be useful to know that you can just assign a bookmark to a string. It looks like you have a separate recordset variable rsCurAnomaly, and it looks like all it does is support a bookmark. Instead, you should be able to do...
  15. MarkK

    Query not giving expected multiplication results

    If you need numbers rounded to some fixed count of decimal places, use the Round() function. ? Round(0.195867, 2) 0.2 ? Round(0.046, 2) 0.05 And it works in queries too.
  16. MarkK

    Show a specific field

    If data state affects the presentation of your user interface, you will need to calculate this presentation in two cases, 1) when user changes said data, and 2) when you arrive at a new record. This being the case, it is common practice to perform this presentation logic in a separate method...
  17. MarkK

    Solved Restrict Data Entry

    In your data, how is this "wrongness" identifiable? It seems like a mistake if there is more than one product table.
  18. MarkK

    Solved Combo/List Box Lookup Add Item

    If you set the RowSourceType of a ComboBox or ListBox to "Value List", you can run the AddItem() method to add a row to the list, so you can loop through any enumerable list, and fill the control programmatically that way. If you have multiple columns, delimit column data with a semi-colon...
  19. MarkK

    count query.

    Moving data around in a relational database, as you are experiencing, is a difficulty kind of like paddling upstream. What I would be more likely to recommend is that you use a query to identify problem rows or areas in your existing table, and present your number 4) as queried from source using...
  20. MarkK

    count query.

    I don't understand this overall requirement. You delete 123.1 so you can find areas where 123.1 should exist? Seems to me if you don't do 3), then you don't have to do 4), and then 1) and 2) are pointless, and *poof*, the whole problem evaporates. So I don't get it.
Back
Top Bottom