Search results

  1. 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...
  2. 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)...
  3. 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...
  4. 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?
  5. 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!!
  6. P

    query sql word convert into vba code

    I have a cross query which works well, it is: 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 UNION ALL select 'Total' as pncode,null as...
  7. P

    could you please correct my following code

    After a textbox ("Name") I need a serial number in my form, so I write the following on the afterUpdate event of name: ************* Dim sdate As String Dim sNum As Integer sdate = Format(Date, "yyyymmdd") sNum = DMax("mid([dtjm],3,3)", "aa", "Right([dtjm],8)= sdate") If...
Top Bottom