Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sorry, I didn't notice you had Number there. I'm not up on Oracle data types, but you probably want Integer or Long.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #17
    newaccess is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    33
    I changed it to long. But I still do not see msgbox appears. no error message.
    how to debug SQL return value in VBA codes?

    some wrong?

    I need some help in detail

    Newaccess

  3. #18
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you post the db, or a representative sample?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #19
    newaccess is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    33
    in button click event

    Private Sub Command2_Click()
    Dim curDatabase As Object
    Dim rstNWD As Object
    'Dim comfirmNUM As Integer
    Dim comfirmNUM As Long
    'Dim comfirmNUM2 As Integer
    Dim comfirmNUM2 As Long
    Dim conConnector As ADODB.Connection
    Dim strConnection As String
    Dim strStatement As String

    strStatement = "select max(INVOCLE_NUMBER) from SALES;"

    Set curDatabase = CurrentDb
    'Set tblNWD = curDatabase.TableDefs("SALES")
    Set conConnector = New ADODB.Connection
    conConnector.Open "DSN=xx_ODBC;UID=sales1;PWD=sales_rep;"
    conConnector.Open strConnection
    conConnector.Execute strStatement
    'comfirmNUM = CLng(strStatement.INVOCLE_NUMBER)
    comfirmNUM2 = DMax("INVOCLE_NUMBER", "SALES")

    Forms!Form_Formtest!Text0 = comfirmNUM
    MsgBox comfirmNUM2
    MsgBox comfirmNUM
    DoCmd.RunSQL "insert into SALES (SCODE, INVOCLE_NUMBER, TRANSACTION_DATE, COMMENTS) values (10697, '1111', '7/25/2009','test xxx');"

    conConnector.Close
    Set conConnector = Nothing
    End Sub

    in VBA codes, I used a oracle database table sales. in Access linkedtable name as test_sales.


    Thanks for you help!
    Newaccess

  5. #20
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'm not clear on whether you still have a question, or reporting success.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #21
    newaccess is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    33
    codes does not works.
    could you correct it?
    Thanks very much!

  7. #22
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'm back to:

    Quote Originally Posted by pbaldy View Post
    Can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #23
    newaccess is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    May 2010
    Posts
    33
    MS Access 2007 in window 7.
    No access tables. ONLY linktable with ODBC to Oracle database
    Actually, I want to create a data enter form and put data into oracle database. the oracle table already is linked into Access table.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 07-07-2010, 12:57 PM
  2. Replies: 5
    Last Post: 03-29-2009, 07:20 AM
  3. how to connect ms access to sql
    By marianne in forum Access
    Replies: 22
    Last Post: 03-24-2009, 11:14 AM
  4. Replies: 0
    Last Post: 03-09-2009, 12:20 PM
  5. Replies: 3
    Last Post: 04-05-2006, 04:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums