Results 1 to 5 of 5
  1. #1
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84

    "Query input must contain at least one table or query"


    Hi,

    I need following Insert Query:

    INSERT INTO [Contracttype] ( ContractType, [Maandprijs ContractType], JaartalId )
    VALUES (Forms![Aanpassing prijzen].[Subform_Bijkomende_ContractType].Form![ContractType], Forms![Aanpassing prijzen].[Subform_Bijkomende_ContractType].Form![Maandprijs], (Select Id from Jaartabel WHERE Jaartal= Forms![Aanpassing prijzen].[Subform_Bijkomende_ContractType].Form![Jaartal]));

    But it results in the message : "Query input must contain at least one table or query"

    Does anypne know what is the issue?
    Thanks in advance,
    Kind regards,
    Bart

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    not sure but think you are missing a form in each of your values

    Forms![Aanpassing prijzen].form.[Subform_Bijkomende_ContractType].Form![ContractType],

  3. #3
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84
    hi,

    No, that is not it....

    When I test the Select statement with hardcoded values (not retrieved from the form), it return correctly the Id, but as soon as I put this Select statement as part of the Insert Query, it seems not to work .... :-s

  4. #4
    John_G is offline VIP
    Windows 10 Access 2016
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Is [Contracttype] actually the name of a table? My guess is that it is not, especially since Contracttype also is the name of a field within it.

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    No, that is not it....

    When I test the Select statement with hardcoded values (not retrieved from the form), it return correctly the Id, but as soon as I put this Select statement as part of the Insert Query, it seems not to work .... :-s
    my point was the 'path' to the control looks to be incorrect. And I don't see a select statement

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

Similar Threads

  1. Replies: 6
    Last Post: 06-24-2016, 06:07 AM
  2. Replies: 4
    Last Post: 12-20-2015, 12:16 PM
  3. Replies: 4
    Last Post: 10-16-2013, 01:39 AM
  4. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  5. Replies: 3
    Last Post: 04-06-2012, 09:14 AM

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