Search results

  1. Surjer

    Compare 2 tables

    Using recordsets is about the slowest way to do it. I would still use an update query. and call it with code. Just search the queries section and there is TONS of samples you will find as far as syntax of the query...
  2. Surjer

    Compare 2 tables

    - I think this might work??? Sub Create() Dim OriginalRS As Recordset Dim DataRS As Recordset Set DataRS = CurrentDb.OpenRecordset("Select * from [Data]") Do While Not DataRS.EOF Set OriginalRS = CurrentDb.OpenRecordset("Select * from Original where OriginalRS!CustCode = " &...
  3. Surjer

    Compare 2 tables

    A quick and dirty way would be to write an update query and then call it from code. DoCmd.OpenQuery ("MyUpdateQuery") If you need help with the query post back... Hope that helps...
  4. Surjer

    Remote Macro Access

    sorry - I edited the post as to not pass on bad info.... I could have sworn I did that before. Guess not cause I just tried it and it didnt work...
  5. Surjer

    Variables not resetting on DB close

    The only way I can see this happening is in using Automation and your not setting the application free. like Dim X as object set x = createObject ("Access.Application.8") and then it crashes at some point so x never gets set to nothing. This would leave access running in the background...
  6. Surjer

    need code to clear texbox

    on the change event of your combo box txtbox.txt = ""
  7. Surjer

    Remote Macro Access

    You have 2 database's right? So DatabaseA has the macro and databaseB has the tables you want to update/modify? Couple of things to consider - I would create a db with just the tables in it and store that on your Network and then create a front end to distribute with the macro's and code in...
  8. Surjer

    3 forms, one bit of code, use a module?

    You need to open the recordset and make it editable. its this line: Code: Open "SELECT * FROM TBLPacks WHERE PackRef = " & iPackID, cn, adOpenStatic Needs to be: Open "SELECT * FROM TBLPacks WHERE PackRef = " & iPackID, cn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic
  9. Surjer

    Compact the CurrentDB

    The databases have to be closed in that example too... But that is a nice tool for backing data up. Good find :ThumbsUP
  10. Surjer

    3 forms, one bit of code, use a module?

    Ahh yes - Good eye If PackRef is defined as a string in the table the SQL must hard code in the quotes. Didn't know you could do this. .Open "SELECT * FROM TBLPacks WHERE PackRef = " & iPackID & "'", cn, adOpenStatic I have been doing this .Open "SELECT * FROM TBLPacks WHERE PackRef = "...
  11. Surjer

    Compact the CurrentDB

    Yeah amazing the INFO that is currently stored on this site - A little searching and WAMMMM
  12. Surjer

    Compact the CurrentDB

    The end user is not Access Knowledgeable plus why should they have to hit extra keystrokes to do this. I think I found a solution from a while back - Send Keys (Yarrrr)
  13. Surjer

    Compact the CurrentDB

    Hello all and thanks in advance for any suggestions. My current project seems to be bloating itself rather fast. How do I implement this code to the current DB? Note that this opens a DB exclusively so I am sure it has to be ran while the DB is closed???? Public Function...
  14. Surjer

    Yes/No message box!

    If CheckBox.Value = True then If msgbox("The Check Box IS checked",vbYesNo) = 6 then DoCmd.Close acForm, "MyForm", acSaveYes End if End If
  15. Surjer

    3 forms, one bit of code, use a module?

    Can you post a sample DB??
  16. Surjer

    3 forms, one bit of code, use a module?

    which line of code is it blowing up on?
  17. Surjer

    copy all fields from a record to a different table

    You will want to write an append query. And run it with DoCmd.RunSql "MyInsertSQL" If you need help with the actual SQL then This has heaps of info - Start Here
  18. Surjer

    Did a query return a record

    You do not need to use the DoCmd.OpenTable unless you want to see the table. If you want to access the data via code then the recordset is what you want. Now, A recordset Points to data stored in a table. So to access the data you must use a SQL statement. Like "Select * from [Current...
  19. Surjer

    Did a query return a record

    Depends on how u run the querie. This is a pretty Common Method I have seen used to the death.... Dim DB as Database Dim rs as recordset Dim qryText as String Set DB = CurrentDB QryText = "Select * from MyTable" Set RS = DB.OpenRecordset(QryText) If not rs.recordcount = 0 then 'Do What you...
  20. Surjer

    3 forms, one bit of code, use a module?

    Create module called anything and paste this into it... Public Function MyFunction() Dim cn As Connection Dim vbasuid As String Dim vbpackref As String Dim vbasstate As String Dim vbasdate As String vbasuid = asuid vbpackref = Text6 vbasstate = asstate...
Back
Top Bottom