SubForm Question

B

Bob V

I have 2 Continuous Subforms on the same Form , both have the same Record
Source I am trying to get the top subform only to show one line the blank
line, how would I do that .....Thanks for any help............Bob
 
J

John W. Vinson

I have 2 Continuous Subforms on the same Form , both have the same Record
Source I am trying to get the top subform only to show one line the blank
line, how would I do that .....Thanks for any help............Bob

Set its Data Entry property to True.

You may also want to remove the "new record" line from the lower subform (if
you're doing what I think you're doing, putting the new record line at the top
of the list) by setting that subform's Allow Additions property to No.

John W. Vinson [MVP]
 
B

Bob V

Thanks John I did both those things bottom subform is perfect just the top
one is the problem, Setting the top Data Entry to "True" is Yes isn't it?
Thanks Bob
 
J

John W. Vinson

Thanks John I did both those things bottom subform is perfect just the top
one is the problem, Setting the top Data Entry to "True" is Yes isn't it?

True, it's "Yes". Or yes, Yes is True. Or something like that... <g>

John W. Vinson [MVP]
 
J

John W. Vinson

I set it to that but cant get the blank row to the top...Thanks Bob

Now you've lost me.

You should have two subforms - one with one row (blank, or containing only the
just-entered row); the other containing all existing rows.

You'ld simply arrange them on the screen so that the former is just above the
latter, neatly lined up so it looks like one.

No?

John W. Vinson [MVP]
 
B

Bob V

Hi John, I do but when I reduce the size of the top subform it showing my
top line in the sub form below , I cant get it just to show the blank line
unless in scroll down the to sub form......Regards Bob
 
J

John W. Vinson

Hi John, I do but when I reduce the size of the top subform it showing my
top line in the sub form below , I cant get it just to show the blank line
unless in scroll down the to sub form......Regards Bob

Please rephrase the following. This sentence no verb.

What is the Recordsource of each subform?
What are the Data Entry, Allow Edits, Allow Additions properties of each
subform?
What record or records are you seeing on each subform when you open the
mainform?

John W. Vinson [MVP]
 
B

Bob V

John W. Vinson said:
Please rephrase the following. This sentence no verb.

What is the Recordsource of each subform?
*******TopSubForm SELECT * FROM tblRemarks ;
******BottomSubForm SELECT * FROM tblRemarks ORDER BY [SrNo] DESC;
What are the Data Entry, Allow Edits, Allow Additions properties of each
subform?
******TopSubForm Yes,Yes,Yes
*****BottomSubForm No,Yes,No
What record or records are you seeing on each subform when you open the
mainform?
******************************************
Found out whats going on When I go to my form (Filtered) it is incorrect ,
stDocName = "frmHorseInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acLast
BUT if I select this way it is not correct its Just showing the same as the
top subform , but bottom subform in different sort
If CurrentProject.AllForms("frmHorseInfo").IsLoaded = True Then
DoCmd.Close acForm, "frmHorseInfo"
End If
If cbActiveHorses = "" Or IsNull(cbActiveHorses) Then Exit Sub
DoCmd.OpenForm "frmHorseInfo", acNormal, , , , , "FromMain"
******************************************
 
B

Bob V

Sorry John , This entry in to my form shows the sub forms to be Correct
stDocName = "frmHorseInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acLast
Thanks for your help....Bob

Bob V said:
John W. Vinson said:
Please rephrase the following. This sentence no verb.

What is the Recordsource of each subform?
*******TopSubForm SELECT * FROM tblRemarks ;
******BottomSubForm SELECT * FROM tblRemarks ORDER BY [SrNo] DESC;
What are the Data Entry, Allow Edits, Allow Additions properties of each
subform?
******TopSubForm Yes,Yes,Yes
*****BottomSubForm No,Yes,No
What record or records are you seeing on each subform when you open the
mainform?
******************************************
Found out whats going on When I go to my form (Filtered) it is incorrect ,
stDocName = "frmHorseInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acLast
BUT if I select this way it is not correct its Just showing the same as
the top subform , but bottom subform in different sort
If CurrentProject.AllForms("frmHorseInfo").IsLoaded = True Then
DoCmd.Close acForm, "frmHorseInfo"
End If
If cbActiveHorses = "" Or IsNull(cbActiveHorses) Then Exit Sub
DoCmd.OpenForm "frmHorseInfo", acNormal, , , , , "FromMain"
******************************************
John W. Vinson [MVP]
 
J

John W. Vinson

Sorry John , This entry in to my form shows the sub forms to be Correct
stDocName = "frmHorseInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acLast
Thanks for your help....Bob

Bob, you're assuming that I have more knowledge of your database than I
possess.

This refers to opening a mainform. It has nothing whatsoever to do with either
of your subforms. You don't "open" a Subform - it's just sitting there in a
Subform control on your mainform.

Please:

Open your Form in design view.
Select the Subform which you want on top - the new record subform.
Click the little square at the upper left.
If you don't see the form's properties, select View... Properties.
Post the subform's Recordsource property, Allow Addtions property, and Data
Entry property.

Now do the same for the second subform.

John W. Vinson [MVP]
 
B

Bob V

Thanks John, Record Source property for the top subform
SELECT * FROM tblRemarks ;
Record source for the bottom subform
SELECT * FROM tblRemarks ORDER BY [SrNo] DESC;
John if I open the Form [HorseInfo] which hosts 2 subforms by filter it does
not show blank record at the top, in top subform
But I open Form by
stDocName = "frmHorseInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acLast
the top subform is correct
Thanks Bob
 
B

Bob V

Hi John I changed the code of my dropdown Combobox/List on my Main Form to
select HorseInfo and its working perfect now
Private Sub cbActiveHorses_AfterUpdate()
'16 Sept 2005,Pallavi
'If CurrentProject.AllForms("frmHorseInfo").IsLoaded = True Then
'DoCmd.Close acForm, "frmHorseInfo"
'End If
'If cbActiveHorses = "" Or IsNull(cbActiveHorses) Then Exit Sub
'DoCmd.OpenForm "frmHorseInfo", acNormal, , , , , "FromMain"
'Added by Bob Vance 7 Aug 2007
DoCmd.OpenForm "FrmHorseInfo", , , "HorseID =" & Me.cbActiveHorses
End Sub

BUT I have another dropdown Combo box/List on HorseInfo to get me from one
horse record to anther and I am getting that same scenario doing it that way
Any suggestions would be appreciated thanks ..Bob

Private Sub cbHorse_AfterUpdate()
DoCmd.OpenForm "FrmHorseInfo", , , "HorseID =" & Me.cbHorse
End Sub


Bob V said:
Thanks John, Record Source property for the top subform
SELECT * FROM tblRemarks ;
Record source for the bottom subform
SELECT * FROM tblRemarks ORDER BY [SrNo] DESC;
John if I open the Form [HorseInfo] which hosts 2 subforms by filter it
does not show blank record at the top, in top subform
But I open Form by
stDocName = "frmHorseInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acLast
the top subform is correct
Thanks Bob

John W. Vinson said:
Bob, you're assuming that I have more knowledge of your database than I
possess.

This refers to opening a mainform. It has nothing whatsoever to do with
either
of your subforms. You don't "open" a Subform - it's just sitting there in
a
Subform control on your mainform.

Please:

Open your Form in design view.
Select the Subform which you want on top - the new record subform.
Click the little square at the upper left.
If you don't see the form's properties, select View... Properties.
Post the subform's Recordsource property, Allow Addtions property, and
Data
Entry property.

Now do the same for the second subform.

John W. Vinson [MVP]
 
J

John W. Vinson

Thanks John, Record Source property for the top subform
SELECT * FROM tblRemarks ;
Record source for the bottom subform
SELECT * FROM tblRemarks ORDER BY [SrNo] DESC;
John if I open the Form [HorseInfo] which hosts 2 subforms by filter it does
not show blank record at the top, in top subform
But I open Form by
stDocName = "frmHorseInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria

What's in stLinkCriteria?
DoCmd.GoToRecord , , acLast
the top subform is correct

So is there still a problem???

John W. Vinson [MVP]
 
J

John W. Vinson

DoCmd.OpenForm "FrmHorseInfo", , , "HorseID =" & Me.cbActiveHorses
End Sub

BUT I have another dropdown Combo box/List on HorseInfo to get me from one
horse record to anther and I am getting that same scenario doing it that way
Any suggestions would be appreciated thanks ..Bob

Private Sub cbHorse_AfterUpdate()
DoCmd.OpenForm "FrmHorseInfo", , , "HorseID =" & Me.cbHorse
End Sub

Since I have no idea what might be in cbHorse, what's in frmHorseInfo, or what
problem you're having, I'll just have to check back on Monday. Perhaps you
could post some usable information.

Please, again, remember: YOU can see your application. We cannot.

John W. Vinson [MVP]
 
B

Bob V

Only problem is when I go to cbHorse [ComboBox drop down list] that lets me
select what record I want to go to . I am on frmHorseInfo and [CbHorse] lets
me select another record/form to go to that's when I have the problem with
the subform, if worst comes to worst I will delete [CbHorse] then I will
have to go back to frmMain [Switchboard] and select my next Horse/Record
Thanks John.............Bob

John W. Vinson said:
Thanks John, Record Source property for the top subform
SELECT * FROM tblRemarks ;
Record source for the bottom subform
SELECT * FROM tblRemarks ORDER BY [SrNo] DESC;
John if I open the Form [HorseInfo] which hosts 2 subforms by filter it
does
not show blank record at the top, in top subform
But I open Form by
stDocName = "frmHorseInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria

What's in stLinkCriteria?
DoCmd.GoToRecord , , acLast
the top subform is correct

So is there still a problem???

John W. Vinson [MVP]
 
J

John W. Vinson

Only problem is when I go to cbHorse [ComboBox drop down list] that lets me
select what record I want to go to . I am on frmHorseInfo and [CbHorse] lets
me select another record/form to go to that's when I have the problem with
the subform, if worst comes to worst I will delete [CbHorse] then I will
have to go back to frmMain [Switchboard] and select my next Horse/Record
Thanks John.............Bob

You may want to Requery the subform in the AfterUpdate event of the combo box.

John W. Vinson [MVP]
 
B

Bob V

Thanks John,

Form - frmHorseInfo
Top SubForm - subRemarksBlank
Bottom SubForm - subRemarks
Both have a Text Box - tbRemark

If I put a requery in tbRemarks/After Update what do I requery too?
Thanks for your Help John.......Regards Bob


John W. Vinson said:
Only problem is when I go to cbHorse [ComboBox drop down list] that lets
me
select what record I want to go to . I am on frmHorseInfo and [CbHorse]
lets
me select another record/form to go to that's when I have the problem with
the subform, if worst comes to worst I will delete [CbHorse] then I will
have to go back to frmMain [Switchboard] and select my next Horse/Record
Thanks John.............Bob

You may want to Requery the subform in the AfterUpdate event of the combo
box.

John W. Vinson [MVP]
 
J

John W. Vinson

Thanks John,

Form - frmHorseInfo
Top SubForm - subRemarksBlank
Bottom SubForm - subRemarks
Both have a Text Box - tbRemark

If I put a requery in tbRemarks/After Update what do I requery too?
Thanks for your Help John.......Regards Bob

Just changing the value in tbRemark should not require that anything be
requeries. You may want to open the Form within the subform control
subRemarksBlank and add code to the Form's AfterUpdate:

Private Sub Form_AfterUpdate()
Parent!subRemarks.Requery
End Sub

John W. Vinson [MVP]
 
B

Bob V

Oops Sorry John the name of the Bottom sub form was RemarksChild, Anyway
thanks got it requiring to the bottom subform now [RemarksChild] but if you
enter more than one record in the top SubForm you really only what was
happening before, you get your vertical slider and the records mount in the
top subform. Is there anyway that in after update that it will delete the
record out of the top subform!

Thanks for you help with this subform......Bob
 
Top