Search results

  1. D

    function to return Date/Time

    Woah! Good tip... I recomend everyone that doesn't know about this check it out. There's tonnes of stuff in there that just doesn't get returned by the search... Thanks Pat, Sam.
  2. D

    INSERTing a new record

    Hey Kodo, that "@@IDENTITY" doesn't seem to be recognized as valid SQL...What's going on with that statement, and where can I find out more about it? Thanks, Sam
  3. D

    Relationships

    This is probably a stupid question, but here goes anyway... In my table relationships map, one of my tables whose primary key has a one to many relationship with multiple other tables, all of which enforce referential integrity, has what looks like a "1L" beside it instead of just a "1" like my...
  4. D

    INSERTing a new record

    edit: nevermind...fixed.
  5. D

    INSERTing a new record

    Ah! That was a slight brain-fart...thanks Kodo. Sam.
  6. D

    INSERTing a new record

    Two things--- 1) I'm using DAO, but that's no biggie, I can change the syntax 2) My INSERT INTO query is stored in access so that I can take advantage of the speed of a stored QueryDef. The query is called qry_CreateNewInitiative...is there an easy one liner way of calling this query, so that I...
  7. D

    INSERTing a new record

    Yes, that is the code I will use to create a new record. After it runs, I need another query to fetch the InitiativeID of the record that was just created (unless there is some way to get it via the UPDATE query?) After the new record is created, the user performs a bunch of data entry via...
  8. D

    INSERTing a new record

    I've just got a saved query called qryCreateNewInitiative that has the following sql in it: INSERT INTO tbl_Initiative ( InitiativeName ) VALUES ('*******NEWINITIATIVE*******'); Then I've got a form that needs to run that query. I know that I can use a QueryDef object to open and run that...
  9. D

    INSERTing a new record

    Thanks Kodo, I'm noticing now that my INSERT INTO statement is in fact not inserting a new record into my table. Is there some special way of doing this when the key field for the table in question is autonumbered? Edit: Additionally, here's a dumb question: I've got my INSERT INTO query as a...
  10. D

    INSERTing a new record

    Hey, I've got a form that a user can "Create New" item effectively adding it to a table, however, lots of supporting data needs to be filled out in the form, and some supporting forms as well (not subforms) before the user can ultimately "Save" or "Cancel" the Add-item form. In the...
  11. D

    Ultimate phone number formatting

    It should work like that right now... if not try the following instead: Public Function FormatPhoneNumber(ByVal inputNumber As Variant) As String Dim phonenumber As String Dim temp As String Dim i As Integer temp = "" If Not IsNull(inputNumber) And Not...
  12. D

    Ultimate phone number formatting

    By the way By the way, make sure the input to this function is in fact a string. Your explanation of what you're doing is pretty vague, but if you're feeding the function data from a table, make sure the table field is of the string datatype. The newest code that I posted will handle both 10...
  13. D

    Ultimate phone number formatting

    Okay, here's the version of the code I'll be using (I think) Public Function FormatPhoneNumber(ByVal inputNumber As String) As String Dim phonenumber As String Dim temp As String Dim i As Integer temp = "" If Not IsNull(inputNumber) Then phonenumber =...
  14. D

    Ultimate phone number formatting

    Good point, that definitely would have been the best way to do it :) I just wrote that example up in a few seconds though...however I'll be doing this for my PhoneFormat code. In any event, I think the actual function was doing what it was supposed to do...have you been able to get it working...
  15. D

    Get next available key field

    Hey Pat, Yeah, I was careful not to use the word "subform" because of the obvious confusion it might cause--my pop-forms are in fact just regular forms. The way my forms are laid out, they don't actually specify a recordsource in design view--rather I import my required data in code (I know...
  16. D

    Get next available key field

    Here's my most recent problem... I have a data entry form to add a new record to a table. This form has several buttons on it to call up addition forms which deal with tables that support the main data entry table in a one-to-many relationship. In order for these supporting forms to be able...
  17. D

    Ultimate phone number formatting

    It's hard to say without more information...the function itself works given that it is provided the apropriate data, so you need to examine the context in which the function is called, and make sure that it's being passed the apropriate data, and that what you're trying to do is handling the...
  18. D

    Ultimate phone number formatting

    You need to put a THEN at the end of that IF statement IF inputNumber <> "" AND inputNumber <> NULL THEN ..... Sam.
  19. D

    Ultimate phone number formatting

    How are you passing inputNumber parameter to the function? You have to make sure you handle the NULL case in the calling code, or add apropriate code to the function to handle the NULL case. Try IF inputNumber <> "" AND inputNumber <> NULL Sam.
  20. D

    function to return Date/Time

    Perfect. Thanks Rich! Sam.
Back
Top Bottom