Results 1 to 5 of 5
  1. #1
    Fiona is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2009
    Posts
    3

    Make a table query

    Hello,

    Thank you for reading my post.

    I have put together a button to run a "Make Table" query. In the query is a field that grabs a date from a form. When you run the query in the "Navagation Pane" it works perfectly.



    The problem is when I run the query from a button. I get an error message that the engine does not recognize [form]![frmMain]![txtDate].

    Any ideas, suggestions or hints are greatly appreciated.

    Thank you,
    Fiona

  2. #2
    Rameez is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2009
    Location
    Chennai, India
    Posts
    40
    did u try Forms_frmMain.txtdate or in ur query use Forms instead of Form

  3. #3
    Fiona is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2009
    Posts
    3

    variable used in query for Crosstab

    Rameez,

    Thank you for replying to my post.

    After more research, it turns out that the problem is with a crosstab. The crosstab is used in another query that makes up part of the 'make table' query.

    In the query that the crosstab is made from, I use a date criteria that is set by the user via a form. If the query is pointed to the texbox in the form, the crosstab throws the 'does not recognize [forms]![form1]![txtbox1]. However, the crosstab does work if I actually put the date in the query and not reference the date to a textbox in a form.

    Any ideas?

    Thank you!
    Fiona

  4. #4
    Rameez is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2009
    Location
    Chennai, India
    Posts
    40

    Smile

    SELECT DISTINCT slam.mtn
    FROM SLM slam
    WHERE (((slam.Ven)=Forms!ChartVen!cboven))
    ORDER BY slam.mtn;

    This is the sql i used in a query and it did work perfectly.

    I have linked this query to a combo box cbomtn....AND ONE IMPORTANT THING, I HAVE REQUERIED the above query AFTER cboven is populated(in my code)

    Private Sub cboven_AfterUpdate()
    cbomtn.Value = Null
    cbomtn.Requery
    cbomtn = Me.cbomtn.ItemData(0)
    End Sub

    use it as required by you.

    In your case the problem is [form]![frmMain]![txtDate] is not getting recognized...so in ur code...use requery option so that the value u give in txtDate gets populated.

    Thanks & Regards
    Rameez

  5. #5
    Fiona is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2009
    Posts
    3
    Rameez,

    Thank you very much for your attention and effort to this. It turns out that I had to complete the 'query parameters' box in one of the queries that feeds into the crosstab. I have never needed to use the 'query parameters' box before and am not sure why it was needed, but it works now.

    Thank you again for your attention and follow up with this.

    Fiona

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Add descriptions for make table queries
    By HurrMark in forum Access
    Replies: 0
    Last Post: 12-30-2008, 08:29 AM
  2. Adding new column to make-table query
    By dtn118 in forum Access
    Replies: 2
    Last Post: 08-03-2008, 06:51 AM
  3. Using same query with different table
    By fashoda in forum Queries
    Replies: 1
    Last Post: 12-14-2005, 12:05 AM
  4. Replies: 1
    Last Post: 12-09-2005, 09:27 PM
  5. Use same query with different table
    By fashoda in forum Access
    Replies: 1
    Last Post: 12-09-2005, 08:44 PM

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
  •  
Other Forums: Microsoft Office Forums