A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Reference Subform



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 12:51 PM
Bandit
external usenet poster
 
Posts: n/a
Default Reference Subform

Hi,
I am automating the data input of a couple items in a
subform. It rund fine by itself but errors when I tie it
into a form that I use as a filter. The mainform and
subform have no data linkage items

Pick Category...
Pick Area...

Subform pops up with the correct form that needs to be
populated


This is what is in the main form which has to fields that
are used as filters

//////
Private Sub cboPlatform_AfterUpdate()
If cboPlatform = "Cents" Then
Me.cboCategory.RowSource = "SELECT DISTINCT
[tblOptions_Cen].[Category] FROM tblOptions_Cen; "
Me.sfrmOptions.SourceObject = "sfrmOptions_Cen"
Me.cboCategory.Requery
Else
'other stuff
end if
/////////

This is what is in the subform and it runs fine
independendly of the mainform

//////
Private Sub Form_Current()
Dim rs As Object
Set rs = Me.Recordset.Clone

If rs.EOF Or Not Me.NewRecord Then
' don't do anything if there's no records or it is
not a new record
Else
With rs
.MoveNext
Me![Category] = .Fields("Category")
Me![Area] = .Fields("Area")
End With

End If

End Sub
//////

When I run the mainform with the subform coded this is
what is thrown...
when adding a record it gives me error '2113'value not
valid for this field...
and it highlights
Me![Category] = .Fields("Category") 'this is in the
subform


Anyone know how to fix this? And why?

Thanks,
Bandit

Ads
  #2  
Old May 25th, 2004, 02:37 PM
StCyrM
external usenet poster
 
Posts: n/a
Default Reference Subform

Hi

The proper reference to the subform would be as follows:

[forms]![MainFormName]![SubformName].Form!ControlToReferenceOnSubForm

Maurice





Hi,
I am automating the data input of a couple items in a
subform. It rund fine by itself but errors when I tie it
into a form that I use as a filter. The mainform and
subform have no data linkage items



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004-2017 OfficeFrustration.
The comments are property of their posters.