Search results

  1. JMongi

    Next Available Number that includes missing gap numbers

    Looks like I'm doing very similarly to this form, but I was unaware of Format(Me.txtSeqNum, "000")
  2. JMongi

    Next Available Number that includes missing gap numbers

    @Pat Hartman - I wasn't planning on it, but it was a novel idea. I don't like to implement code I don't personally understand so I wrote my own functions for incrementing a string full of numbers including leading zeroes. Function LeadingZeroIncrement(ByVal NumToIncrement As String) As String...
  3. JMongi

    Next Available Number that includes missing gap numbers

    @Pat Hartman - Definitely true. I think an assumption got made somewhere in the thread that I was talking about PKs but I am not. @Cotswold - That is an interesting suggestion, I never thought of creating 99,999 records in advance. Interesting concept. @sxschech - Thanks for the code...
  4. JMongi

    Next Available Number that includes missing gap numbers

    No, I just wanted to give an example of the full drawing number and that it is technically a string not a number. The part that is incremented is the 5 digit middle part.
  5. JMongi

    Next Available Number that includes missing gap numbers

    Just to clarify, these are not table ID numbers at all. These are unique drawing numbers. We have gaps because we've never really had a great system for managing drawings. I don't even know how large the gaps will be. It's certainly easier to ignore them but I'm investigating NOT ignoring...
  6. JMongi

    Next Available Number that includes missing gap numbers

    I'm working on a little app to assign and track our drawing numbers. As such, our current drawings are going to have some gaps in the drawing number scheme. I can use a Dmax to find the greatest number and increment that. But, that won't do much for filing in gaps of missing numbers. I'm...
  7. JMongi

    VBA Command for Complex Select Case?

    A little mini rant here... Why, why, why are Microsoft's sample code blocks so lame and uninformative in their VBA support section? The samples given were so basic and practically out of a programming 101 textbook. I realize that can be very useful for the beginner. However, even one more...
  8. JMongi

    VBA Command for Complex Select Case?

    @theDBguy - No I haven't. Does that work? That would be cool, that's what I'm looking for. I did a lot of googling and couldn't find a single example with that structure. I thought I'd seen it before (probably here) but couldn't hit on it on my own. @Pat Hartman - Yes, I'm looking for that...
  9. JMongi

    VBA Command for Complex Select Case?

    That's a bummer. I like the limited execution idea of the case statement too, i.e. ending the code block when an expression evaluates as true. Trying my hand at some input validation on an AfterUpdate event.
  10. JMongi

    VBA Command for Complex Select Case?

    Is there a VBA command that functions similarly to Select Case but without the simple individual source? A normal Select Case is like: Select Case MyNum Case 0 : MsgBox "The number is 0" Case 1 : MsgBox "The number is 1" Case > 1: MsgBox "The number is greater than 1" Else...
  11. JMongi

    All records in table disappeared

    Consider a different security setup: card keys for building entry. Now to make this applicable our card key entry system would require a card swipe and then the entry of user's pin number. To summarize: swipe the user's unique card, enter the user's unique pin number. To gain unauthorized entry...
  12. JMongi

    All records in table disappeared

    There are other considerations, but from a strictly security standpoint (i.e. making it difficult for unauthorized individuals to login) providing a list of correct usernames is providing one half of the login "key" already (albeit the easy half). Requiring a user to ENTER his username AND...
  13. JMongi

    Finding Record ID of newly inserted record

    Me personally, even if the identifier is a number, I would store it as a string variable because you aren't actually USING it as a number (performing calculations, etc.). Obviously, since PK-FK pairs have to have the same type that overrides my personal preference! In this case the normal...
  14. JMongi

    Finding Record ID of newly inserted record

    Maybe someone more knowledgeable can comment about why the function works when a string variable needs delimiters still. For reference, here is the function code: Public Function GetDomainUsername() As String 'Get the users Windows Domain Login username Static sUser As String If sUser = ""...
  15. JMongi

    Finding Record ID of newly inserted record

    It should. But it was a dumb one! :) I had the field value set to number because originally it was going to be FK reference. I was trying to write a string to a number field! Duh! Problem fixed! Code working!
  16. JMongi

    Finding Record ID of newly inserted record

    I got it now. Thanks.
  17. JMongi

    Finding Record ID of newly inserted record

    So, here is my latest code. First record insert works. Storing the ID of that record works. Still getting a type mismatch on the second. Private Sub Form_AfterInsert() Dim db As DAO.Database Dim RevDate As Date Dim strSQL As String Dim lngLastID As Long Set db = CurrentDb() RevDate = Date...
  18. JMongi

    Finding Record ID of newly inserted record

    Maybe that part was throwing me off?
  19. JMongi

    Finding Record ID of newly inserted record

    So, maybe I've misunderstood @Pat Hartman and @theDBguy 1. Is there a way to use @@IDENTITY without using it in conjunction with a DAO recordset like theDBguy's code? 2. If I use DAO VBA commands will that be compatible with a future migration to SQL server? 3. Do my questions indicate that I...
  20. JMongi

    Finding Record ID of newly inserted record

    I'm still working through what you posted. But, I noticed "Status" flagged in the Code indentifier. Is that a reserved word in SQL? should i change my field name to something else?
Back
Top Bottom