Consulting

Results 1 to 2 of 2

Thread: Access code pull data in forms.fields from sql request troubleshot

  1. #1
    VBAX Newbie
    Joined
    Dec 2013
    Posts
    2
    Location

    Access code pull data in forms.fields from sql request troubleshot

    Hello , could tell me why i cant copypaste data from sql request in the field of the forms on Access here
     Private Sub Form_Open(Cancel As Integer) 
    ' dim strSql as string       
    strSQL = "SELECT table.[ID_Excel] FROM table wHERE ID=" & OrderID  Debug.Print strSQL  
    ' correctMe.RecordSource = strSQL 
    ' nothing happening Me.field0.value = strSQL  
    ' wrote in the field SELECT table.[ID_Excel] FROM table wHERE ID=" '
     and not value of the SQS for example  15000 
    end sub
    Last edited by Aussiebear; 04-19-2023 at 03:34 PM. Reason: Adjusted the layout of the supplied code

  2. #2
    VBAX Newbie
    Joined
    Dec 2013
    Posts
    2
    Location
    Private Sub Form_Open(Cancel As Integer) ' form_test открывается 
    dim strSQL as string 
    strSQL = "SELECT zayvki.[ID_Excel] FROM zayvki wHERE ID=" & OrderID 
    Debug.Print strSQL ' запрос есть как положено
    Me.RecordSource = strSQL ' ничего не делает here **** 
    Me.поле0.value = strSQL ' Here **** пишет в самом поле SELECT zayvki.[ID_Excel] FROM zayvki wHERE ID=" 
    ' а не результат запроса , например 15000 
    end sub
    Last edited by Aussiebear; 04-19-2023 at 03:32 PM. Reason: Adjusted the code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •