Allow multiple lines in continuous form but hide New Record line?

ctpoodle

Registered User.
Local time
Today, 03:47
Joined
Dec 27, 2012
Messages
27
Hi there! I have a form which, upon selection of one answer from a combo box, may open a second form, bringing with it the File Number from the record of the first form. So, upon selection of the specified item, an append query is put into action in order to add that file number to the secondary table for the second form. That's great. In the second form, the user is asked to provide one or more "causes" for that file number. So, the way I have it set up now is the user selects the first "cause" and if they have any additional, they hit the "Add Another" button, which copies the File number field and pastes it into the new record.

So, my question/s:
A) Is there a more efficient way to do this? I'm currently "adding another" by way of a macro.
And importantly,
B) Is there a way to not show the blank New Record row unless/until the "Add Another" button is pushed? The risk here now is that if someone just goes down to the New Record row without pressing the button, the File number isn't copied and we lose a way to connect the records.

Thanks!
 
If you want to do this with macros, you should post in the macro forum.

I never dirty a record in a popup form unless a user dirties it first. That means that my code is placed in the Form's BeforeInsert event. This event fires only once per record immediately after the user types the first character in any control. I use this event to populate the foreign key value so the record will be linked to the current record in the form that opened this one. My reason for this is to prevent the creation of "empty" records caused when users press the button to open the popup form when they didn't mean to. Once they start typing, it can be asumed they know what they are doing:)

Using this technique, the second and subsequent records added would all use the same code so special code isn't required.

If you change the form's AllowAdditions property to No, the New Record row will disappear.
 
I don't necessarily WANT to do this with macros. Unfortunately, I did this with macros because I don't yet know VBA. I'm picking bits up here and there and have incorporated some code, and would love to have this all done in VBA, but in the meantime, I have to have something so macro it is.

By dirtying the record first, I assume you're referring to the fact that I'm placing the file number in there. What is actually happening is that on the first form, I'm doing a copy, append paste to a secondary table. The 2nd form runs off a query which filters off that file number, and so it appears on the form. (Does that make sense?) The users want to type in as little as possible, which is why I want to copy that file number again if they want to add additional lines (maybe that's where you're referring to dirtying the form?)

Clearly I'm still a newbie when it comes to writing code so I apologize if I'm just not understanding you. :(

Thanks!
 
I can't help you with macros. You'll do better in the macro forum.
 

Users who are viewing this thread

Back
Top Bottom