ajetrumpet
Banned
- Local time
- Today, 07:22
- Joined
- Jun 22, 2007
- Messages
- 5,628
OK Rainman, are you ready for the disection of this???
Well, sorry to come in at this late stage and maybe point out something obvious but, isn't this a normalization issue?
From what I've read, it seems like you have repeating information within this table. Everything about the (up to) 5 records is identical except the caseID from your combo, no?
To me it's a classic many-to-many situation between expenses and cases.
I would imagine you need a a junction table between your Cases table and your Expenses table.
Then, all you need is a subform bound to the junction table in your form, instead of just a combo. The subform would be in continuous form view and use the Expense tables PK as the master/child key.
Or am I missing something?
Happy to help. Sometimes it's easy to lose sight of the woods for all the damned trees in the way
And this approach also saves you future grief if ever someone wants to put six cases on an expense...or seven...
Good call!Just don't mutter out-loud on the forum when the 6-case expense turns up 5 months from now![]()
I like that idea!Or, if Adam has got the code working you can just use that.No skin off my nose!
Just don't mutter out-loud on the forum when the 6-case expense turns up 5 months from now
Good call!I like that idea!
I'm wondering something else too Craig...how messed up was the data? I've looked at the file only a few times. I guess I treated like any other 100MB .mdb file I open; just fix the problem.I saw a DB file the other day that was like 5MB in size, but it had over 30 objects in it!! When I see that kind of a thing on opening it up, I don't think I wanna spend my entire day re-writing the script. I praise your efforts.
I see what you did, question is, if i were to go back and want to review the entries, how would i do that seeing as no fields are bound? guess this is something id have to look into. seeing as printing the sheets is based on what one is shown on the form.Ray,
I don't know what Craig is talking about, but here is your initial problem, fixed. The code for the close button is completely different.
Craig might be right though, and restructuring to fit your needs may be in your future.
If you need an explanation of what I did, just let me know. Bottom line - The control sources that you had on your form were the cause of the duplicate record. There is no need for them if you already have the append code written.
Make sure you understand what the "Dirty" property means too.![]()
I didn't know this. Tell me more about it...Review entries? What does the review of entries have to do with bound fields?I see what you did, question is, if i were to go back and want to review the entries, how would i do that seeing as no fields are bound? guess this is something id have to look into. seeing as printing the sheets is based on what one is shown on the form.
Who told you that!? That isn't true...well what i mean by review is after i enter them, and i want to go back and see what i have entered. may it be a single record or whatever. then no records will show because of the fact that the records need to be bound to the fields in the table to show them.
DoCmd.OpenReport "ReportBasedOffOfTheTableOrQueryWhichNowHoldsTheAppendedRecords"
Print duplicates?well i have that currently, but its based on the expense ID that was on the form. that way only one was printed at a time. i had it do all but if someone enters one and comes back later to enter another. they will print some duplicates, and i like to save paper!!!!