Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008

    Unanswered: Add data from SELECT query to a form in MS Access

    Hi there
    I have got an other query. I am trying to display the bunch of data retreived from SELECT query in the form. I tried using the grid control to display and iam getting the runtime error 438 Object doesnt support this property or method.
    Code i have written is

    Dim cnn As ADODB.Connection
    Dim rst As ADODB.Recordset
    Dim SQL As String

    Set cnn = CurrentProject.Connection
    SQL = "SELECT [weekly data].[Case ID], [weekly data].[SLA Violated], [weekly data].[End User Department], [weekly data].[Affected End User Name], [weekly data].Severity, [weekly data].[Case Category], [weekly data].Status, [weekly data].[Arrival Time], [weekly data].[Resolved Time], [weekly data].[Time Open], [weekly data].[Business App Affected], [weekly data].Fix, [weekly data].Summary, [weekly data].Description, [weekly data].[Customer Satisfaction Survey], [weekly data].[Root Cause], [weekly data].[Sent to Clarify], [weekly data].[Clarify ID], [weekly data].[Configuration Item], [weekly data].[Date of First Transfer], [weekly data].[Latest Status Change to 3-Hold], [weekly data].[Work Log] FROM [weekly data]" ' WHERE [weekly data].[SLA Violated]= " & yes & " "

    Set rst = New ADODB.Recordset

    rst.CursorLocation = adUseClient
    rst.Open SQL, cnn, adOpenStatic, adLockBatchOptimistic

    Set Grid4.DataSource = rst

    Can some one give me a suggestion of using this better way. I also need the "SLA Violation" field should be editable (ie i should have an functionality of chenging from yes to no or viceversa and provide a text field to enter the valid reason and store back in the database)

    Much appreciate if you can tell me the code what to include to get this done.

  2. #2
    Join Date
    Apr 2005
    Zagreb - Croatia
    Try next:
    Make an APPEND query, (instead of select qry). This query is going to save the records in the table, (wich is the base for your form). After query use a REQUERY method on your form.

Posting Permissions

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