What is the process to check data entry??

PNGBill

Win10 Office Pro 2016
Local time
Tomorrow, 07:41
Joined
Jul 15, 2008
Messages
2,269
Hi Forum,

Just so I know what to search for.

What is the process called where in a form The On Enter Event will check to see if the number entered is a number belonging to the record.

We have MemberID and LoanID
The Form has an ApplicationID that can be matched to a MemberID and then to all of That Member's LoanID's
Easy to do a query to select just the relevant records for a given ApplicationID.

On the Form, when a LoanID is entered it must be a number that appears in the above selected record's LoanID's

I suspect this could involve a complicated sql statement in the On Enter Event:confused:
 
This sql identifies the possible values for the LoanID in the form.

SELECT TBLLOAN.LDPK AS LoanID, TBLLOAN.ADPK AS MemberID, TBLAPPLOAN.APLPK AS ApplicationID
FROM TBLLOAN LEFT JOIN TBLAPPLOAN ON TBLLOAN.ADPK = TBLAPPLOAN.APLACCDET
WHERE (((TBLAPPLOAN.APLPK)=WhatEverCriteria))
ORDER BY TBLLOAN.ADPK;

The criteria is in the the subform. it is the link to the main form.

Any links to how to get this into vba for the On Enter Event ??
 
Another way is to have the form bound to the table with the loanID field, then create a hidden textbox bound to the loanID field. Each time a number is entered a filter shall be applied to the form to select a loanID equals to the entered number. Then compare the entered number with the loanID textbox. If true then the entered number is a valid loadID.

OR simple use the Dlookup fuction to search for a loanID = to the entered number. If it returns a value then the entered number is a valid loanID
 
Thanks AliyuKatsina.
Will try your ideas. I am using the subform on more then one mainform which may make changing the data source tricky but will try.

Also, the two values are not in one table and they are not one to one.

The linked value on the subform - [ApplicationID]
The value I want to confirm is acceptable is from a list of this [MemberID] (single) previous [LoanID] (plural)

A query needs to join 3 tables to get all the occurrences of [LoanID] where the [MemberID] (not on the subform) is the [MemberID] related to [ApplicationID]
 
I have another subform on the mainform - Mainform with two subforms along side each other.

This other subform has the records in question.

Can the entry in subform B be compared against the entries in subform A and force a match.
SubformB [OldLoanID] (One Record) compared to SubformA [LDPK] (Many Records)
 

Users who are viewing this thread

Back
Top Bottom