Search results

  1. K

    Question about JOIN!

    Hello, I want to link a table to 2 other tables in order to change its values. I wrote: CurrentDb.Execute "UPDATE Table1 INNER JOIN Table2 ON Table1.column = Table2.Column, Table3 ON Table1.Column = Table3.Column SET Column2 = Table2.Column2 WHERE Table3.Column = Table1.Column;" But is...
  2. K

    Is the DAY() function possible??

    Date: [Date1]-Day([Date1])+Day([Date2]) I know this has some problems with it...because it is not running...but can this be possibly done and if yes how? Thank you!
  3. K

    Data Type Mismatch???

    I have got problems runnign this SQL it says its got Data type mismatch... what does it mean and why is this happening?? Thank you!! Sqlstr = "" Sqlstr = Sqlstr & "SELECT IL4010DA.Pnumber, IL4010DA.Code, ([ValDate]-Day([ValDate])+Day([Pyd])) AS fdate...
  4. K

    What is invalid use of Null??

    When I run this code it says "Invalid use of Null", but all my vairables have values...i dont understand what it has got to do with Null...=( If tmpyr = "Y0" Or bus_type = "FB" Then r = 0 Else r = Max(0, DLookup(tmpyr, "CSV_" & bus_type, "Age=" &...
  5. K

    How can i UPDATE a column with a value input in tht FORM?

    CurrentDb.Execute "UPDATE ValuationDate SET Valdate = Forms![MainScreen].[InputDate].Value;" tmpvaldate = Forms![MainScreen].[InputDate].Value CurrentDb.Execute "UPDATE ValuationDate SET Valdate = tmpvaldate;" both of them didnt work...=(
  6. K

    Problem with UPDATE function

    Is this not possible? MySQL = "UPDATE Table1 SET Column1 = Pol.Column1;" DoCmd.RunSQL MySQL If not, how can I do it? Thank you!!
  7. K

    Convert to SQL

    How do i convert this into SQL?? Thanks =) rst.MoveFirst Do rst.Edit rst![ValDate] = Forms![MainScreen].[InputDate].Value rst.Update rst.MoveNext Loop Until rst.EOF rst.Close
  8. K

    Runtime Error 3001?!?!?!

    I have written the following code: Sub UpdateIL4010DB() Dim rst As DAO.Recordset Dim tbl As DAO.TableDef Dim db As DAO.Database Dim fld As DAO.Field Dim indx As DAO.Index Set db = CurrentDb Set tbl = db.TableDefs("Rid") Set rst =...
  9. K

    How to call Compact and Repair Database?!?!?!?!

    I wrote this to call compact and repair database between subs in the main module in order to keep the database under 2GB. However, when the program runs, MSaccess says "you cannot compact a database when running a macro/visual basic" i've run this code successfully before and i dont know why its...
  10. K

    How can I compact another database?

    If I want to compact and repair the current database, I write: Sub CompactAndRepairDatabase() CommandBars("Menu Bar").Controls("Tools").Controls("Database utilities").Controls("Compact and repair database...").accDoDefaultAction End Sub But what if I want to compact and repair another...
  11. K

    How do i delete a linked table??

    If I want to delete a table that is in the database, I write: On Error Resume Next CurrentDb.TableDefs.Delete "Pol" But what if the table is a linked table? How do i delete the table/delete the link? Thank you!
  12. K

    how do i link a table?

    I've written the following to produce a table in a new database. Now I need to do things with it eg. create indexes. How do I link the table to my current database using vba codes? (i want this done immediately and automatically after the table is created in the other database) Many thanks if...
  13. K

    cut and paste table?!?!

    I want access to automatically cut and paste (or copy and paste then delete) a table into a new database when i click on a button. how do i do it? thanks!
  14. K

    How do I create a table in new database?

    Dim Sqlstr1, Sqlstr2 As String Sqlstr1 = "create table Fbal;" Sqlstr2 = "SELECT IL4010DF.* INTO Fbal FROM IL4010DF ORDER BY IL4010DF.Pnumber;" DoCmd.RunSQL Sqlstr1 DoCmd.RunSQL Sqlstr2 CurrentDb.TableDefs.Delete "IL4010DF" Call CreatePKIndexes("Fbal", "Pnumber"...
  15. K

    How do I open a linked table?

    If a table is imported into the database, we write: Dim rst_p, rst_r As DAO.Recordset Set db = CurrentDb Set rst_p = db.OpenRecordset("Pol", dbOpenTable) Set rst_r = db.OpenRecordset("Rid", dbOpenTable) But if the tables are linked instead, what code should i write to open it...
  16. K

    How do I click on a button in one database, then create a table in another database?

    Hello! I have some codes that will import a table fro text file, then fill in null cells with some appropriate values. It will become so big that I need to separate this table from the others in another database and then link it. How do I click on a button on a form in one database, then...
  17. K

    How do i delete all the records in a table but retaining the structure?

    Please Help! Thank you so much! =)
  18. K

    How do I delete a record?

    I need to append a number of records into an existing table of records. I would like it to delete the existing record when on error. What code should I write to delete a record?
  19. K

    How do I append a field?

    i wrote this code. it runs fine until the last light where a msg box says "cannot define field more than once". Have i typed in some wrong code? Dim rst As DAO.Recordset Dim tbl As DAO.TableDef Dim db As DAO.Database Dim fld As DAO.Field Set db = CurrentDb Set tbl = db.TableDefs("Pol")...
  20. K

    what does this mean?

    when i want to run a query it says "you tired to execute a query that does not include the specified expression 'Dur1' as part of an aggregate function" what does this mean? Dur1 is in the table and it has got valid values...i dont understand what has gone wrong..=.=
Back
Top Bottom