Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No data entered into a sub forms causes query to return no data

Status
Not open for further replies.

Troopa

Technical User
Nov 9, 2001
96
GB
hi,

I've been having a problem with the for a while and tried a few options but still can't get it to work...and it seems like such an obvious requirement...

I have a couple of forms that have sub forms, if no data is entered into the sub forms, the queries dont work.

So, how can I ensure that if no data is entered, either the user is prompted to enter data? The database is split and the required fields dont work for some reason. I have got it so that if one record in the subform is populated it will prompt the user to enter details into the other fields but this doesn't stop the user from tabbing through all fields entering no data at all?

Can anyone offer a solution to this?

thanks in advance
 
I think your question is somewhat vague (what do you mean queries "don't work"?) and I don't understand "if one record in the subform is populated it will prompt the user to enter details into the other fields".

Having said that, my first suspicion is your queries are using the default join type (inner) and should be using an outer join.

Sure hope that was helpful.

 
I'll get back to you on the parts that need clarifying.
I think you're right that I'm using inner joins (will have to check tomorrow) but I've never used Outer joins or how to make the different from inner joins? Sorry if a dumb question, just haven't got access to look right now and curious
 
Double-click on the join line to open the Join Properties dialog box. It will be apparent from there.

 
I see what you mean and I think therefore that I'm using outer join. I don't think that is a query issue though as the query works fine but only when the forms are completed correctly.

This is the query
----------------------------------------------------
SELECT tblCustInfo.txtCustSurname, tblCustInfo.dtmDateEntered, tblCustInfo.CustID, tblAgentData.ynCCContactLogLeft, Nz([tblRiskData].[ynRAContactLogLeft],False) AS RiskLog, tblContactInfo.txtPostCode
FROM ((tblCustInfo INNER JOIN tblContactInfo ON tblCustInfo.CustID = tblContactInfo.numCustID) INNER JOIN tblAgentData ON tblCustInfo.CustID = tblAgentData.CustID) LEFT JOIN tblRiskData ON tblAgentData.CustID = tblRiskData.CustID
WHERE (((tblAgentData.ynCCContactLogLeft)=True) AND ((Nz([tblRiskData].[ynRAContactLogLeft],False))=False));
-------------------------------------------

What I need to be able to do is force the users to enter data into tblAgentData because if they don't, the query doesn't work. ynCCContactLogLeft can not be False.

I don't know why the Required Field doesn't work but I'm guessing it's to do with the Table relationships / split database?

I'm totally lost and I've been working on this DB since the begining of the year...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top