Not in List events for multiple combo boxes

  • Thread starter Thread starter sike11 via AccessMonster.com
  • Start date Start date
S

sike11 via AccessMonster.com

Hello all,

I wonder if you can help me.

1)I have 12 records on a form by use of combo boxes. At any stage, a user
might enter data which is not in the underlying tables.

I would like to use 1 procedure for all the records.

How would I use the same procedure for the NotinList event on 12 combo boxes
in/on the form?

2) Currently, I have a form which can be used to enter the information
required. However, I am unsure how to link the 2 forms so that part of the
data is carried over into the 2nd form.

3) On the second form, I would like data carried to look in the table and if
there is no matching record for the user to go ahead and enter the
information as required. If the data already exists, to say that it is a
duplicate record and should not be entered.

Thanks for all help in advance.

Mary.
 
1) Did you mean 1 fields? A record is made up of one or more fields and a
table is made up of one or more records. Also, when you mention Notinlist
event do you mean that you are going to allow the data entered to be placed
in the "list"? If both answers are yes then you can't use one procedure to
do for all 12 combo box lists since each Sub has to be named by the Combo
box's name and you would have different field names anyhow. You can create a
procedure for one and copy the code to the other 11, changing the necessary
names, etc.

2)Use code to open the second form before closing the first form and pass the
info needed to objects in the second form by using =[Forms]![first form name]!
[first form field] or use a tabbed form, placing what you have on the first
form on the first tab and what you have on the second form on the second tab.

3)Set a unique identifier such as Parts #, SS #, Employee ID # to No
duplicates and Access won't allow the data to be entered. This should be the
first entry field so that when a duplicate is typed, the user can go no
farther.
 
Thank you for the quick response.
1) Yes to both questions.
2) That works!!
3) How would I tell the user that this is a duplicate record and cannot be
entered?

I will try what you suggested.
Again, thank you.

Mary.
1) Did you mean 1 fields? A record is made up of one or more fields and a
table is made up of one or more records. Also, when you mention Notinlist
event do you mean that you are going to allow the data entered to be placed
in the "list"? If both answers are yes then you can't use one procedure to
do for all 12 combo box lists since each Sub has to be named by the Combo
box's name and you would have different field names anyhow. You can create a
procedure for one and copy the code to the other 11, changing the necessary
names, etc.

2)Use code to open the second form before closing the first form and pass the
info needed to objects in the second form by using =[Forms]![first form name]!
[first form field] or use a tabbed form, placing what you have on the first
form on the first tab and what you have on the second form on the second tab.

3)Set a unique identifier such as Parts #, SS #, Employee ID # to No
duplicates and Access won't allow the data to be entered. This should be the
first entry field so that when a duplicate is typed, the user can go no
farther.
Hello all,
[quoted text clipped - 20 lines]
 
I told you something that is incorrect. The user WILL be allowed to continue
entering data in the record even if the unique identifier is a duplicate.
The user would get a message from Access telling him that the changes made
"were not successful because they would create duplicate values in the index,
primary key, or relationships..."
Sorry for that.
Thank you for the quick response.
1) Yes to both questions.
2) That works!!
3) How would I tell the user that this is a duplicate record and cannot be
entered?

I will try what you suggested.
Again, thank you.

Mary.
1) Did you mean 1 fields? A record is made up of one or more fields and a
table is made up of one or more records. Also, when you mention Notinlist
[quoted text clipped - 20 lines]
 
Go here:
http://www.accessmonster.com/Uwe/Forum.aspx/access/12961/Duplicate-records
and copy the code you see in the response to your forms On Error event
Procedure changing strmessage to suit your needs. This will be better than
the Access generated message.
Thank you for the quick response.
1) Yes to both questions.
2) That works!!
3) How would I tell the user that this is a duplicate record and cannot be
entered?

I will try what you suggested.
Again, thank you.

Mary.
1) Did you mean 1 fields? A record is made up of one or more fields and a
table is made up of one or more records. Also, when you mention Notinlist
[quoted text clipped - 20 lines]
 
Back
Top