473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Problem with record addition in subform

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):

http://199.166.6.89/~%61%67v%69ro/Pr...stProblems.mdb

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.

Thanks!

S Kitty

Jul 26 '06 #1
2 1417
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_cmdNewCompany_Click:
Exit Sub

Err_cmdNewCompany_Click:
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

pi********@hotmail.com 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Joe Scully | last post by:
Hi all, I am having trouble with access adding a blank record to a subform everytime I finish entering data and closing the form. (The form and subform are based on the one table) When...
1
by: xmp333 | last post by:
Hi, I have a form that is designed as a data sheet view. Attached to this is a subform with some VB code. When the user clicks on a row, the subform should pop up and run the VB code which...
3
by: DavidGeorge | last post by:
I have 2 subforms, neither of which is linked to the main form. Of the left of my form is a subform with a list of organisations and on the right is a subform with details of the organisation...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.