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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text boxes and labels don't appear in details section of forms

Status
Not open for further replies.

sonseph14

Programmer
Mar 23, 2006
16
0
0
US
We created a database and attempted to show a number of different text boxes from several different tables in the details section of a form. Everything appears correctly in design view, but when we got to view the form, nothing appears in the detail section of the form. We've been attempting to figure this out for a few days, but have had no luck. Any help would be appreciated. Thanks.
 
When you say "different text boxes from several different tables", do you mean with a query?
 
Could the first record in your table or query somehow be blank?
 
Here is what is going on. We're creating a transaction database system to store product information from transaction at a local business.

On the one form we're creating, we want to be able to show the transaction information on the form which includes the transaction id, and other information such as the date and time. We also want to be able to enter in the product information such as the product id, size, color, price etc. These are 2 seperate tables, Transaction table and product table. When we attempt to show these fields in the details section of the form they don't appear when viewing it. Is there any way to do this??

Hopefully that helps. Thanks.
 
What is not showing? the data in the fields or the fields themselves? If it's the fields, check properties to ensure that "Visible" is set to "Yes"

-- Fast Learner, I Think

Here's something to think about. How come you never see a headline like 'Psychic Wins Lottery!'? - Jay Leno
 
There are a few ways to do what I think you want to do. One is to create a query based on the two tables and set the record source of your form to this query. Another is to bind the form to whichever is the main table and create a subform for the dependant table. Is this the kind of thing you are thinking of?
If not, please add a little information, such as whether the form is bound, and to what. It will help to narrow down the areas in which the problem could be occurring.
 
I think that's what we need to do. The labels and text boxes themselves aren't showing up. That's the problem. I'll attempt the query way being that it seems like the easier fix. If not then I guess I will be back. Thank you for the information. It's vastly appreciated.
 
I've attempted what you said, but the fields still are showing up. The exact thing I'm doing is creating a query/form using the wizard. I'm then taking all the fields from our transaction table and product table. When the form is created, everything will show up in the header, but when the fields and or labels are moved to the details section of the form nothing appears. I've tried everything. Visible is checked for everything. I'm lost as to what to do.
 
Me too. Can we check a few things?
When you created the query using the two tables that you want the form to be based on, did it show the records you wanted when you opened it?

I do not quite get this bit about the header. When a wizard is used to create a report, the fields and labels are put in the detail section, unless you are creating a continuous form, in which case the labels are in the form header and the fields in the detail section.

Is it worth trying Autoform (on the toolbar) with the query, to see if this gives something near to what you want, and if not, in what way is it wrong? I have a feeling I am missing some important point you have made. [ponder]
 
There is no record to show. We want to be able to type in product information such as the size being bought, color, etc. And yes, we want the form to be a continous form so that after one product is entered you can enter another during the transaction.

Will the fields not show up if there is no data to show?? If this is the case then is it possible to have the fiels appear to have information entered into them?
 
I think you must have set Allow Additions to No. If there are no records in the recordset, and Allow Additions is set to No, fields will not appear because there is nothing that the user is allowed to do.
You may wish to look at the Order form for the sample Northwind database. I think it is similar to the set-up you wish to use.
 
We finally got the forms to show up using the subform that you had suggested. The problem we have now those is that the form isn't opening in add mode and we wish to do that. When we open the Transaction form which has our products subform in it, it shows all the current records that would have been in the database. Instead, we want it to show up blank, in add mode, so that we can add a new record to that table, the product subform.

We've tried using several different pieces of code, but have had no luck in doing so.
 
Have you tried setting the Data Entry property of the form to Yes?
This can also be done in code. It is one of the arguments for
DoCmd.OpenForm ...
 
How are ya sonseph14 . . .

Wow! . . . is there data in the tables?


Calvin.gif
See Ya! . . . . . .
 
Could it be that perhaps you have a line of code somewhere which sets the visible to false for all controls?

-- Fast Learner, I Think

Here's something to think about. How come you never see a headline like 'Psychic Wins Lottery!'? - Jay Leno
 

sonseph said:
We finally got the forms to show up ...
29 Mar 06 18:08
Which means, I think, that missing controls are no longer an issues, as of 29 Mar 06 18:08.

 
Seems I skipped over that one. Still it doesn't seem it was resolved, but an alternative was applied. I know, the key thing is that it works. [pipe]

-- Fast Learner, I Think

Here's something to think about. How come you never see a headline like 'Psychic Wins Lottery!'? - Jay Leno
 
I swear that as soon as one problem is solved, another comes up instantly. We've now got the forms showing up correctly, and the subform is now opening in add mode. Everything looks good, so that's a plus. The problem we're having now is the actual data entry.

The main form is called Transaction. The subform is called OrderLine. We have focus set to the OrderLine subform becuase that's where we want to enter the data. The main Transaction form is just displaying things such as the date and time and adding up prices from the subform OrderLine. The problem is that when we order information into the subform and tab out to enter another record to the subform we get the following error: "You cannot add or change a record because a related record is required in table 'Transaction'". We looked in the actual Transaction table and the current record is there. We're not sure why this is occuring if it shows the record being there. The only thing we can think of is that the record in the subform OrderLine isn't the same, but we enter the data exactly the same.

I'm not sure if anyone can help with this problem being that it seems to be rather obscure, and I don't know how to explain it any farther. Thank you for your help thus far though.
 
I do not know how much this will help, but here goes anyway.
Say you have set a relationship in the relationship window between Transaction and OrderLine to TransactionID and you have set Enforce Referential Integrity. When you try to add an item to OrderLine that does not have a TransactionID that matches an ID in Transaction, the system will whine in the way you have mention, that is "You cannot add or change a record because a related record is required in table 'Transaction'". Is it possible that a relationship of this nature has been set up somewhere along the line and not abided by?
It can often be useful to test with queries as it eliminates some of the complications that forms introduce.
 
I've checked out the Enforce Referential Integrity in the Relationship diagram. Just to test this out, I unchecked the box on the relationship between the Transaction table and OrderLine table. Once this was removed the database worked correctly. Obviously the problem is now that there is no record in the Transaction table but there is one trying to be saved in the OrderLine table.

To get around this we tested out a save button on the main form, the Transaction form. Before entering our record in the subform, the OrderLine form, we clicked the button. We then entered the information in the subform and it worked correctly.

This is just a nuissance though because if the user has to click a save button everytime they enter the form, it's inconvient to them. I'm not sure if you know code on how to save a record but we're attempting to add code to the Form_Load event to save the Transaction record before entering our record in the subform. We tried to just copy the code from the button but this didn't work. Do you know the code of how to do this.

Sorry this post was so lengthy. Once again, thank you for helping me along Remou! You've been such a great help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top