Sorry, should probably be:
Me.List8.ItemData(0)
I forgot to edit my post after I discovered error.
Suggestion - give controls more meaningful names, like tbxDate, lbxDates, tbxEnv, lbxEnvs.
Sorry, should probably be:
Me.List8.ItemData(0)
I forgot to edit my post after I discovered error.
Suggestion - give controls more meaningful names, like tbxDate, lbxDates, tbxEnv, lbxEnvs.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Now that I look at this I suspect (even though I no nothing of VB code) the error is legit .....as the date (Text10) is blank when the form is opened. So the fix would be to have a date in Text10 when the form is opened?
The error was because code references the wrong listbox. Did you fix the code to reference the correct listbox?
Also, this won't work for existing records, only new records. You will have to manually enter/select a value for existing records.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
OK...made the latest changes you sent and it appears to work great! I did some quick testing. I will do more testing Wed. So far I am happy!![]()
Further testing has uncovered an issue. When updating the form Sunday Collection, a bogus entry is added to the New Giving Table with an $ amount, env# and a 1/6 date. Still investigating what is going on. I hope to be able to provide more info with more testing.
When I make my first entry in the Sunday Collection form, it seems to take a record with a newer date in the New Giving table for the first envelope# in that table and moving it to a 1/6 date with the money from that record. As an example when I entered a record for Sunday 8/11 for env#24, that record was added but it also took the record for env#2 (which is the first one) for the week of 2/10 and moved it to 1/6. So my weekly totals for the Sunday of 1/6 are up $18 and the totals for 2/10 are low by $18. Perhaps I did not put the VB code in correctly? See how it looks below:
Private Sub Form_Load()
Me.Text10 = Me.List8.ItemData(0)
Me.Text10.DefaultValue = "#" & Me.Text10 & "#"
End Sub
Private Sub Form_AfterUpdate()
Me.Text10.DefaultValue = "#" & Me.Text10 & "#"
End Sub
Okay, turns out line not needed in the Load event:
Me.Text10 = Me.List8.ItemData(0)
Change the line that follows it to:
Me.Text10.DefaultValue = "#" & Me.List8.ItemData(0) & "#"
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
A BIG THANK YOU! You are a SUPER, SUPER Moderator! I applied the change and tested it and that worked perfectly. I would like to do a little more testing but the problems I saw previously are fixed! I just want to make sure I am not missing something when I do the massive Sunday money data input. I will know Sunday.
I can't thank you enough for this fix and the critique of the database.