By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,914 Members | 1,718 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,914 IT Pros & Developers. It's quick & easy.

Problem with record addition in subform

P: n/a
Hi everyone!

I have a bit of a weird problem right now with the addition of a record
in a subform.

The database is supposed to keep track of a list of projects for a
consulting company. There are a few sort criteria made by checkboxes,
and the projects shown update immediately to reflect that.

There are a series of companies that work is being done for, and for
each company, a series of projects, and for each project, a series of
invoices. When you add in a project under a specific company, the
subform (in database view) shows it with no problems (the default
values of the project head = Ron, priority = low and status = proposed
are shown at the bottom at all times, which is fine).

The problem is that you can't add an invoice! The invoices have a
dropdown, the source of which is an SQL statement generated from
filterFunction(), so the only projects you can set an invoice to are
the ones from that company, and which meet the filter requirements from
the checkboxes. The dropdown shows everything alright, and when
there's already an invoice present, you can change it to a different
project... but when you try to make a new invoice, it doesn't work.
When I try to select a value from the invoice, the Access status bar
shows "Calculating..." for a brief moment, and then it gives up. When
you try to enter the other data first, you can't set which project the
invoice is for, ever (and it won't save the records after that).

I realize it's a lot to explain, so I've temporarily put this database
online, here (the main form is frmCompanies):

I'd greatly appreciate it if any of you are willing to look my database
over. Like I said, it's just this one problem, the rest is fully
functional. Apart from this bug, I think that I've got some pretty
good filtering and features on this database written up (including a
nice filter-helper function, good for selecting things with
checkboxes), so feel free to use parts of it for your own
non-commercial applications.


S Kitty

Jul 26 '06 #1
Share this Question
Share on Google+
2 Replies

P: n/a
That was easy.

Private Sub cmdNewCompany_Click()
On Error GoTo Err_cmdNewCompany_Click
DoCmd.GoToRecord , , acNewRec
'---Next line causes an error...
'currentCompanyID = Me.CompanyID.Value
iHolder = filterFunction()
Exit Sub

MsgBox Err.Description
Resume Exit_cmdNewCompany_Click

End Sub

Just remove the line that's commented out, and it works a charm..

Jul 26 '06 #2

P: n/a

pi******** wrote:
That was easy.
DoCmd.GoToRecord , , acNewRec
'---Next line causes an error...
'currentCompanyID = Me.CompanyID.Value
iHolder = filterFunction()

Haha, that is indeed a bug fix! It's not actually the problem I'm
referring to, though (Actually, I made a new version of this file so
that I'm not posting clients and projects on the internet, and it's a
bit of a versioning issue that I still had that little mistake on it).

To see the problem I'm having, try adding an invoice through the form.
That's what doesn't work - the dropdown to select which project the
invoice is for.

S Kitty

Jul 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.