Search results

  1. E

    Refreshing a Value on a Form

    It's hard to tell exactly what you are doing with the given information, but it is certainly not necessary to move away from and then back to a record to refresh it. First of all, what is it you are trying to refresh? The contents of a combo box? A calculation? A subform? Depending on your...
  2. E

    get last insert id

    Brent - thanks for the clarification. I have only used MDB - never SQL server yet. Theoretically, in a multi-user environment, when you use .UPDATE then .MOVELAST, isn't there a chance that the last record could have just been added by another user? Evan
  3. E

    Need to Set Text Box Value to Query Result

    Thanks for the details. I will keep it in mind and perhaps give dLookup another chance. Evan
  4. E

    Help with the Append Query in VBA

    Actually, after rereading his posts, I'm not so sure that he is using a date. He has a table that has been named with an 8 digit number that represents a date. He wants to lookup information in this table, but the table name will be dynamic - apparently he has loads of autogenerated tables...
  5. E

    Corruption!!

    I also have 2003 with the latest patches. I think I regularly get your same kind of corruption. It happens to me when I have been opening, closing, editing, and saving forms for a few hours. Perhaps, Access is leaking memory or something, because suddening I will get "These is not sufficient...
  6. E

    Run Time Error - 3251 with Linked database

    I'm away from my Access computer now, so can't try the index function. But, if you use an SQL statement to open the recordset with search criteria, I think it will do the same thing. strSQL = "Select FROM tblItem ..... WHERE ItemID = " & lngItemID & ";" rs = CurrentDB.OpenRecordset(strSQL...
  7. E

    Help with the Append Query in VBA

    I would create the query in the query builder and make sure it is working there. Then paste the SQL statement into VBA, making sure to double up any instances of quotation marks. Once this is working it should be easy to substitute a variable for the table name. Evan
  8. E

    Password on a button to open form

    Haha - at least we agree on something - lol. Evan
  9. E

    Need to Set Text Box Value to Query Result

    Perhaps I'm in the dark ages, but I used a hi-res timer to compare dLookup and eLookup and seemed to find that eLookup was consistantly 5 to 10x faster. Does this mean, perhaps, that I have problems with my indexes? I'm certainly not attached in stone to one method over another.... I just...
  10. E

    Password on a button to open form

    You need to use Option Explicit. Put those two words at the very top of your module, in the global declarations area. This will force every variable to be declared, and save you lots of headaches in cases like this. Evan
  11. E

    Need to Set Text Box Value to Query Result

    I certainly would not use dlookup unless i had to - VERY slow. Allen Browne's elookup replacement is much better. Evan
  12. E

    Run Time Error - 3251 with Linked database

    Not sure if you want to go this route, but I used all linked tables with DOA instead of ADO and have no problems. Instead of using the SEEK function, I just give the recordset a SQL statement when it opens. Dim rs as DAO.Recordset, rs2 as DAO.Recordset Dim strSQL as string 'Open 1st...
  13. E

    Question Revert all Changes made to a Database?

    How about an unbound form with an Update button? Changes are not saved to a table unless button is pressed. Evan
  14. E

    Forward Record Selector creating new records

    Check your code. In Form.Current you probably have something that is causing the record to be dirty. If you can't find it, add a watch for Forms!myForm.Dirty and set it break when value changes. This will show you the line that is causing it. Evan
  15. E

    get last insert id

    You can do it easily by using a recordset instead of a query to add the record. dim lngNewID as Long dim rs as DAO.Recordset set rs = currentdb.openrecordset("MyTable") rs.AddNew lngNewID = rs!MyTableID 'Add other fields rs.Update rs.Close set rs = nothing Remember to grab the Record...
  16. E

    Take Value from List Box Column and place in the body of outlook email

    .body = MyListBox.Column(1,3) You mave have to play with the numbers a bit to get it to point to the right spot. Evan
  17. E

    query over my head (order vs in stock inventory)

    Perhaps you just need to set the join property to "Show all records from Table1 and only matching records from table2". Or maybe try setting propertios to Distict Records or Distinct Values. These are shots in the dark, but I don't have much info to go by. Evan
  18. E

    Stop Cursor from moving to next record

    Perhaps you should try the BeforeUpdate event. If your criteria is not met then: Msgbox... Cancel = True I believe this will retain focus on your control. Evan
  19. E

    Subform best practice

    If your user clicks on the subform and then exits the form altogether, you will have a blank record, which could cause all kinds of problems down the line. I would take Bob's approach and disable the subforms or the tab control until data has been entered in the main form - perhaps the OnDirty...
  20. E

    2108 and 2115 runtime error handling

    You can't change the contents of your control in the before update event. Use the AfterUpdate event - should work fine. Evan
Back
Top Bottom