Search results

  1. V

    FIND Speciffic record and USE it using VBA

    I have a table with country names and currencies. I am using VBA and am opening a recordset and i want to FIND AND USE use only one speciffic record from that recordset. how do i do it? any ideas? i know i can use the find method of the recordsets... how can i use it after i find it.. how do i...
  2. V

    SQL in VBA error in syntax?

    I get the error that is attached as a picture here when i run this query on vba. any ideas? Set RsType = CurrentDb.OpenRecordset("SELECT SOBP,SOBPDEBIT FROM RFGDebitNotes ;") Set RsTbl = CurrentDb.OpenRecordset("SELECT * FROM " & RsType!sobpdebit & " ;") strsqlDBl = " SELECT * FROM " &...
  3. V

    Compact & Repair

    i am using the following code that i found after searching the Forum Code: Public Function CompactData() SendKeys "%(TDC)", False End Function Code: DoCmd.Close acForm, Me.Name, acSaveNo CompactData i added it to the exit button. it does close but the size of the database is not...
  4. V

    Multiplication doesnt work

    i have the following code Sub CUR() 'Update Currency for RFG Dim strsqlCURa As String Dim strsqlCURb As String Dim rsCur As DAO.Recordset Dim rsRows As Variant Set rsCur = CurrentDb.OpenRecordset("SELECT SOBP, CUR from CURRFG;") Do While Not rsCur.EOF DoCmd.SetWarnings (False) strsqlCURa...
  5. V

    Debits and Credits (was posted wrongly in VBA section)

    I have a table that has debits and credits in two different columns along with other info. as you can see from the attached Excel there is one debit for each credit. in some cases though there is one debit and 2 or more credits that sum up that ammount. the common thing that Debits and...
  6. V

    Any ideas why this doesnt work?

    xlApp.Sheets("Sheet2").Select xlApp.ActiveSheet.Range("A1").Select xlApp.ActiveCell.Offset(2, 0).Cells.Select xlApp.ActiveCell.CopyFromRecordset RsProj xlApp.ActiveSheet.Range("N1").Select xlApp.ActiveCell.Offset(2, 0).Cells.Select xlApp.ActiveCell.CopyFromRecordset...
  7. V

    Last row with data in Excel!

    I need to locate using VB the last row that contains data go down 3 rows and start adding a recordset.. i have the recordeset but not the location? any ideas how can i locate it? any ideas where can i find help about the Excel Object? thanks guys
  8. V

    if.. table is empty then...

    I want to write a line that will check a table. if that table is empty i want to execute the following line DoCmd.CopyObject , RDebit, acTable, "Generic" i open the recordset like this.... Set RsDebit = CurrentDb.OpenRecordset("SELECT SOBP FROM RFGDebitNotes;") RDebit = RsDebit!SOBP &...
  9. V

    If... empty fields give MsgBox?

    I have a table and i want to add a control that will give me a message box if there is an empty field. i am running a process that fills a table.. after this is finished i want to add this control? can i indicate which lines are empty? any ideas? if i run an sql from vba for is null then what...
  10. V

    Loop this code!

    i have th following code that runs for one of my tables... the thing is that i need to get the name of the table every time and loop the code. all the tables are listed in one table so i have RFGWORKING (it lists all my working tables) the code for the one table is... 'Table RN00144GE3RFG...
  11. V

    Update table fields from another table!

    I have a table that is static. it has listed the following things. let me call it table A Table A Code Rate Org 123 e rf 234 t rg 125 g lk then i run a query for another table to get the working codes.. these that the only codes am going to use...
  12. V

    Copy Table And Add To Its Name?

    I have the following code that copies tables and i need to add a string on the new table that will be copied. ANy suggestions Set RsSOBP = CurrentDb.OpenRecordset("SELECT SOBP FROM RFG_Append;") strtable = " RsSOBP!SOBP " RFG = "RFG" 'create RFG tables Do While Not RsSOBP.EOF...
  13. V

    Number format in Excel

    I am creating Excel worksheets from my tables using VBA. My tables have numbers with the correct format. Single. standart, 2 decimals. on the sheets created i get just number with 2 decimals. how can i keep the correct formatting? thanks in advance...
  14. V

    conditional format Excel from Access?

    Is there a way to color rows of Excel sheet from Access? i did a search and on Excel forums but nothing. Anyone did somehting like that? for example is Column B has this text then color the whole row? any ideas? i found the code from cheating excel code but how do i condition so i dont...
  15. V

    Excel Calculations from Access

    i have several sheets and i do the following 1. i go to the last cell 2. then move 3 cells on the left 3. i want to do a SUM function there.. any ideas.. this is what i have so far... ActiveCell.SpecialCells(xlLastCell).Select ActiveCell.Offset(rowOffset:=3, columnOffset:=-3).Activate r =...
  16. V

    Change Position in Excel Spreadsheet

    I am finding the last cell with data with the xlLastCell. from there i want to move 3 cells on the left and do a sum there. i know how to do the sum and i can get the code from excel. the problem is that am exporting different tables with more or less rows so the last cell with date is not the...
  17. V

    Help with adding to the code

    After testing and reading i came up with the following code to export a single table ton an Excel Spreadsheet. I cant get to commands for all the things i want.. so if someone can help me or direct me i would be gratefull. 1. I want to export all tables (their names are lister in a table, so i...
  18. V

    Code for Increments!

    i have the following code... Sub Update_Line() Dim strSQL As String Dim rsSOBP As DAO.Recordset Dim a As Integer Set rsSOBP = CurrentDb.OpenRecordset("SELECT SOBP FROM Countries;") Do While Not rsSOBP.EOF a = a + 10 strSQL = "UPDATE " & rsSOBP!SOBP & " SET Line = " & a & ";"...
  19. V

    Type Conversion error

    i am importing from excel and i have a column that has account numbers and at some point i have an account like this... 2C1C18100 on the import i get an error. i set the field to memo, numner or text and still get the same error.. any suggestions? thanks in advance
  20. V

    Query in VBA Syntax!

    Is there a site that will indicate how do i syntax queries in VBA. i cant figure the syntax out. I have searched this site and google and i cant find a unique way to write my queries in vba.. for example.. i get an synatax error on this.. Sub Update_SOBP() Dim rs As DAO.Recordset Dim strSQL...
Back
Top Bottom