DenverBadger
MIS
Problem: User enters data in an unbound field in a form to locate a record but the data isn't descriptive enough to isolate a single record. (Database is for repairing equipment. User enters a serial number, but there are more than one instances of that particular piece of equipment coming in for various repairs at various times.) The VBA procedure would like to present a list of the records found, allow the user to select the record desired, then continue processing.
Constraints: All Microsoft Office products are Office 2003. Operating System is Windows XP.
Problems with solutions already attempted:
1. VB script in the form (call it "Form1") opens a new form (call it "Form2") in datasheet mode with a filter applied to limit the records to just those few that match the limited information provided. Form2 includes an unbound checkmark against each record displayed which the user checks on the record they desire modified. The checkmark records the AutoKey value.
1A. The problem I've encountered is that the variable that Form2 assigns the AutoKey value to is either locked (because it was created in the procedure in Form1) or vanishes when Form2 closes (because it was created in the procedure in Form2), making it rather difficult to pass the value backwards to the calling form, Form1.
2. Instead of calling a secondary form (and triggering secondary procedures), Form1 actually has a subform embedded in it which has its "Visible" property set to false. The subform is a variation on the datasheet form which I called "Form2" in the first description. (Minor variations reflect the differences between being a free-standing form and being a sub-form.) The procedure sets the Visible property to True when it needs to ask the user to select the proper record.
2A. Now, the initial VBA procedure can access data and process it, but the problem is that I'm unable to apply a limiting filter to the subform, so it constantly lists all five-thousand-plus records, making it nearly useless for asking the user to select the correct record.
How do I solve this problem?
Constraints: All Microsoft Office products are Office 2003. Operating System is Windows XP.
Problems with solutions already attempted:
1. VB script in the form (call it "Form1") opens a new form (call it "Form2") in datasheet mode with a filter applied to limit the records to just those few that match the limited information provided. Form2 includes an unbound checkmark against each record displayed which the user checks on the record they desire modified. The checkmark records the AutoKey value.
1A. The problem I've encountered is that the variable that Form2 assigns the AutoKey value to is either locked (because it was created in the procedure in Form1) or vanishes when Form2 closes (because it was created in the procedure in Form2), making it rather difficult to pass the value backwards to the calling form, Form1.
2. Instead of calling a secondary form (and triggering secondary procedures), Form1 actually has a subform embedded in it which has its "Visible" property set to false. The subform is a variation on the datasheet form which I called "Form2" in the first description. (Minor variations reflect the differences between being a free-standing form and being a sub-form.) The procedure sets the Visible property to True when it needs to ask the user to select the proper record.
2A. Now, the initial VBA procedure can access data and process it, but the problem is that I'm unable to apply a limiting filter to the subform, so it constantly lists all five-thousand-plus records, making it nearly useless for asking the user to select the correct record.
How do I solve this problem?