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

subform data disappears when entering data into main form

P: 10
I have a form that contains 1 subform. Everything works fine until I tab into a textbox in the bottom of the main form. The data in the subform disappears on the form, but the table is updated. How to get the data visible in the subform until I exit the form. I have the record selector, naviagtion button and dividing lines set to "No", and the scroll bar to neither. I have the master and child link set to po#'s on the form/subform.
Apr 23 '10 #1
Share this Question
Share on Google+
3 Replies


mseo
100+
P: 181
hi
as I understood from your question you have to link the subform to the mainform for example if you have:
1- tableorders and its PK is orderID (its controls in the mainform)
2- tableordersdetails FK is order_ID (its controls in the subform)
you must link the subform to mainform using orderID
and you can do that from the subform properties window - data tab
link child field order_ID ( replace order_ID with name of the F.K of the tableorderdetails )
link master field orderID of the primary key of tableorders

Hope this helps
Apr 25 '10 #2

P: 10
@mseo
I have linked both main form and subform with the po# as reference. Everything is working fine, because the data does store in the proper tables. The only issue is that when I tab out of subform back to mainform, the data entered into the subform disappears from the screen view, but not the table. I am looking to see why this is happening. I have tried different setting in the field properties, but nothing fixes this issue. Any other idea will be helpful.
Apr 26 '10 #3

mseo
100+
P: 181
hi,
ok cheweedog
you can set your mainform footer as invisible and creating command button and name it Details whereas you click this command button the subform will be visible and the code behind this command button is about preventing the subform from being visible if the required controls in the mainform is null
and this is the code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Click()
  2. If IsNull(Me.name of first control  Or Me.second control Then
  3.     MsgBox "The Fields of  ( your controls are required to add an order and its details", vbCritical
  4. Else
  5.         Me.FormFooter.Visible = False
  6.             Me.FormFooter.Visible = True
  7.             DoCmd.MoveSize Height:=8000
  8.     End If
  9. End Sub
Hope this helps
Apr 26 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.