Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Missing fields in a query?
Mon, Apr 9 2012 1:44 PMPermanent Link

Robert Rowlands

Hi.

My query has 33 fields.

I open it without any objection, but when passing the values to a new record in another table I get the following exception.
...'qryGetContact: Field 'ReferredBy' not found'.

There are 33 fields in the query.  I've now checked the fields count after opening the query and it says 27.

How can this possibly be?

SQL is as follows.

SELECT  
 GroupAutoInc,
 GroupRef,
 FileAs,
 JobTitle,
 CompanyName,
 Address,
 PhoneWork,
 Fax,
 PhoneHome,
 eMail,
 Categories,
 Notes,
 CompanyMainTelephoneNumber,
 FirstName,
 Name,
 HomeAddress,
 LastName,
 MiddleName,
 PhoneMobile,
 ReferredBy,
 Suffix,
 Title,
 WebSite,
 Flag,
 JobsReferals,
 SalutationDear,
 AccountRef,
 AccountsFlag,
 ReferelRefNo,
 Selected,
 MailMerge,
 bInvAddress,
 InvAddress
FROM tblContacts
WHERE tblContacts.GroupAutoInc =:SearchKey

If I run it through dbsys with a value for SearchKey it seems to work fine.

Thanks.
Tue, Apr 10 2012 3:15 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Robert

Six disappearing columns seems a bit weird Smiley

What happens if you open the query in DBSys an just scroll across? Can you see all of the columns?

Try it two or three times and if the same ones are missing it suggests that there's a problem somewhere with your query. If its typed in do a rebuild of your app in case something glitched, if built programmatically check your code.

Roy Lambert [Team Elevate]
Wed, Apr 11 2012 5:35 AMPermanent Link

Robert Rowlands

Hi Roy.

I did a re-build and nothing changed.

I then deleted the query and placed another one on the form and added the SQL.  It now works as anticipated.

I would add that the original query was created by copying an existing one on the form and pasting it back onto the form.  I then named it as needed.  Perhaps that caused some kind of corruption.

Thanks for your assistance.
Image