Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2013
    Posts
    7

    Smile Unanswered: Subform showing only one record with dynamic query string

    I am new to the Access Subfroms.

    I have a problem showing the records in an unbound subform.

    I have an unbound subform named frmSubStock in frmMainStock. There is no master/child relation at all.

    There is just one button, RUN.

    When I click run, the query result should be displaying in the subform.

    The code i am using:

    Dim strqname,SQL As String


    SQL = "Select * from stock"

    db.CreateQueryDef "qryTemp", SQL

    strqname = "qryTemp"


    Me.frmSubStock.SourceObject = "Query." & strqname
    That's all. Whenever I hit RUN button, only just one last record is showing in the query. When i tried with this command, all records are returned in the new query window:

    DoCmd.OpenQuery "qryTemp"

    Thank you so much in advanced.
    Mary

  2. #2
    Join Date
    Nov 2011
    Posts
    413
    The purpose of a subform is to have a master/child relationship.How do you expect to save any records this way?

  3. #3
    Join Date
    Sep 2013
    Posts
    7
    Hi Burrina, thanks for your reply.

    I don't intend to save any records.

    M

Tags for this Thread

Posting Permissions

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