Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form-subform Problem Maybe 1

Status
Not open for further replies.

Ray1127

Programmer
Feb 22, 2002
231
US
I have a form in an Access 2003 Database. The form has a tab control only 1 tab is currently used but more will be added later. Each tab will have a subform for data entry for each program type. The main form has the member information. Each member could be in 1 or more Programs. I had some test data in the database and everything was working fine. Removed the test data so the user's could test with their own data but now when the form is opened nothing is displayed it looks like a form with no controls on it anywhere. The subforms are linked to the main form by the member id and the program id. Why would the controls not display just because no data has been entered yet?
 
I am using Link Master/Child for the Subforms.
Yes the forms are set to allow new records.
Yes that was part of my testing I was able to update the data on all forms and sub forms.

Did some further testing and the properties on the data tab shows allow additions however when I look at the arrows at the bottom of the form the add new record arrow is grayed out. Thanks I overlooked that I have a command button on the form to add new records just need to make sure that when the form opens if no records are found the add new form opens automatically. Thanks. Never would have noticed that.

Thanks Duane
 
I ran into the exact same problem. I guarantee you that your problem is in the queries that the form is based on.

There seemed to be no reason for controls not to display, but that's what happened to me. It was just a blank screen with nothing there, but design view showed all in order.

Ultimately the problem I found was that there were null values in the queries that math computations were based on. In my instance the query the form was based on was itself drawing data from 8 other queries, and if any of them had a null value the screen would appear blank as you describe.

Go back to those queries and run them individually and see what they display. You will find the problem there. I know I did.
 
MacroScope that is the issue. Here's what I have. I have a main form that pulls data from 1 local table and a couple of linked SQL Serve Tables. To display demographic Information. There are 5 Sub Categories and a member may be enrolled in 1 or more of the categories. On the main form I have a drop down that lists the 5 categories. If the drop down is blank or on Uncategorized all records show. Works great. If the drop down is on a specific Category only members enrolled in that category are shown using the filter. The problem is If a categoy has 0 members assigned I get a blank screen with nothing on it. No controls no command buttons nothing just the form header and gray below it. I want the controls to show so the user can add a new record when appropriate.
 
Is there any math function involved? Any calculations? The problem I identified was that I was trying to perform an average or count function on null values. When that happened, on even one of the eight queries that the final query uses as its source, the form mysteriously went completely blank. I found out because I increased the date range I was searching (increased the number of records), and at some point all the queries had values, and then everything came back and worked normally. As soon as the number of records was limited to a point where something had a null value all the fields on the form went away again.

Check the output of each query individually, and work on the ones that give you no output at all.
 
No calculations in the queries there is 1 textbox on the form that calculates the member's age using datediff("yyyy",BIRTH,Now())
 
I solved it. If the user clicks on a tab it does a check prior to changing to that tab and if no data exists it brings up an enrollment form so that a new member can be added. That way there is never 0 members and that is what caused the problem in the first place. If the user cancels the add then both forms are closed.
 
I knew the problem was with nulls. It's exactly what I experienced. I solved mine with the Nz function. I made all the nulls zeroes. No more problems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top