Search results

  1. P

    how to return every 5th records?

    last question: before addnew, can I use the following sentence to clear the table "sheet3"? with rst2 .delete rst2.update end with .........
  2. P

    how to return every 5th records?

    Jdraw, thank you very much! Now you have 60 records in "sheet2", but instead, if you only have 59 records you will get an error message. Why?
  3. P

    how to return every 5th records?

    Hey Jdraw, Can you please attach your mdb file?
  4. P

    how to return every 5th records?

    Thanks a lot Jdraw! 'Set Me.Sheet2_subform.Form.Recordset = rst2 ........this is to show the results in my subform. When I say "failed" means the subform can run, but not the desired result. The subform still shows every records (from 1 to 51 and more....) Now I made a little change: for i=5 to...
  5. P

    how to return every 5th records?

    I have a recordset that has more than 50 records. Now I want to use ADO method to return every 5th records i.e.5;10;15;20....... to makeup a new recordset. And I have the following codes: Private Sub Command4_Click() Dim rst1 As New ADODB.Recordset Dim rst2 As New ADODB.Recordset Dim cnn As...
  6. P

    help with my vba code

    I tried yesterday it doesn't work
  7. P

    help with my vba code

    ************************************ I agree with u, but I am totally confused now. Please just correct my code
  8. P

    help with my vba code

    I only want to make the list box "city" conditional I tested if I put the "end if" after next i, also cannot go through.....
  9. P

    help with my vba code

    thanks for your reply. did you see line 4? If Not IsNull(Me.city) Then '-------I added an condition here
  10. P

    help with my vba code

    hello there. I have the following code which runs well, but after i add a "if" condition, it went wrong with " end if wiithout block if error". ************** Private Sub lookup_Click() Dim i As Variant Dim strWhere As String strWhere = "" If Not IsNull(Me.city)...
  11. P

    how to copy / paste records in subform?

    Hey Mstef, a record consist of textbox, listbox and combo as well. I need to copy whole record.
  12. P

    how to copy / paste records in subform?

    thanks for your help. it seems your sample can copy only one record, same like my code. I want to copy all the records that user selected. I think we need something like "for i=1 to .......(all records)" then loop.....,but I don't know how to write the code.
  13. P

    how to copy / paste records in subform?

    I have a mainform with a subform. As I often need to input similar records in the subform, I made 2 button to copy the record and then amend some fields so that it becomes a new record. For copy I have this button: Me.subform.SetFocus DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70...
  14. P

    add one autonumber field on union query

    thanks for reply in such a late noght I have a "select.......union all select..........." query. I want to add a field, an ordinal number in this query.
  15. P

    add one autonumber field on union query

    hello every body. I want to add one column of autonumber on my union query, is it possible? Can anyone give me a thread? or example?
  16. P

    import a text file to a table

    Thanks VbaInet. Yes it is correct. But I am no good at vba code therefore need help.
  17. P

    import a text file to a table

    the heading is on the second line. and I need vba code to del with this kinda situations
  18. P

    import a text file to a table

    Could any people tell me how to import a text file from the second line to a table? because 1st line contains useless word. thanks in advance!!
  19. P

    query sql word convert into vba code

    strSQL = "TRANSFORM Sum(t.stockqty) AS sumofstockqty SELECT t.pncode, t.unit " & _ "FROM [SELECT querystock.pncode, querystock.unit, querystock.stockDate, querystock.PO, querystock.stockqty FROM querystock " strSQL = strSQL & "WHERE " & strWhere strSQL = strSQL & " UNION ALL select 'Total' as...
  20. P

    query sql word convert into vba code

    it is on the click event, in full it goes like this: ****************** Dim strWhere As String Dim qdf As DAO.QueryDef Dim strSQL As String strWhere = "" If Not IsNull(Me.pncode) Then strWhere = strWhere & "[pncode] like '*" & Me.pncode & "*' AND " End If If Not...
Top Bottom