A
Andrea M
I have been looking everywhere to track down the answer to something that I
suspect is simple but it has eluded me!!!
I am using an Access 2003 ADP project with an MDSE backend. I have just
recently used the wizard to change from and .mdb to an .adp. I have an
unbound form that I use in single form view to display details pieces of
artwork in a collection. I use ADO to bind the recordset after the user
selects a method of filtering the records. Once the filtering method is
selected, a sub is called:
Sub Set_RecordSource(strServerFilter As String)
' Makes sure detail is visible and subform properly linked as connects
RecordSource
If Me.Detail.Visible = False Then
Me.Detail.Visible = True
Me.NavigationButtons = True
blnConnectSub = True
End If
Me.ServerFilter = strServerFilter
Me.RecordSource = "Select * From vwCollectionNoPic"
Me.RecordsetType = adOpenDynamic
If blnConnectSub Then
Me.sub_frm_artist.LinkChildFields = "artist id"
Me.sub_frm_artist.LinkMasterFields = "artist id"
End If
End Sub
vwCollectionNoPic is a view that is based on one table, no joins. Under
form properties, the unique table is set to "Collection" and the resync is
"Select * From vwCollecionNoPic Where artist_id = ?" The form has two
subforms on it. One displays information about the artist from the artist
table. The other uses code to populate a recordset with a server filter.
The recordset simply contains the collection's primary key field,
"catalogue_number" and a picture field. I structured it this way so that
only one picture is loaded at a time.
strSQL = "SELECT [Villanova Catalogue Number],picture FROM vwPicOnly
WHERE " _
& "[villanova catalogue number] = '" & [Villanova Catalogue Number]
& "';"
recPic.Open strSQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
Set frmSub = Forms!frm_main_collection!sub_frm_pic.Form
If Not IsNull(recPic("Picture")) Then
Me.sub_frm_pic.Enabled = True
strServerFilter = "[villanova catalogue number] = '" &
Me.Villanova_Catalogue_Number & "'"
frmSub.ServerFilter = strServerFilter
frmSub.RecordSource = "Select * From vwPicOnly"
Else
frmSub.RecordSource = ""
Me.sub_frm_pic.Enabled = False
End If
If anyone needs any additional information to help me solve this, I'm happy
to provide it.
Thanks in advance!
Andrea
This all seems to work fine except that the data that populates the form is
read only. When you try to edit the data you get "Field 'fieldname' is based
on an expression and can't be edited."
suspect is simple but it has eluded me!!!
I am using an Access 2003 ADP project with an MDSE backend. I have just
recently used the wizard to change from and .mdb to an .adp. I have an
unbound form that I use in single form view to display details pieces of
artwork in a collection. I use ADO to bind the recordset after the user
selects a method of filtering the records. Once the filtering method is
selected, a sub is called:
Sub Set_RecordSource(strServerFilter As String)
' Makes sure detail is visible and subform properly linked as connects
RecordSource
If Me.Detail.Visible = False Then
Me.Detail.Visible = True
Me.NavigationButtons = True
blnConnectSub = True
End If
Me.ServerFilter = strServerFilter
Me.RecordSource = "Select * From vwCollectionNoPic"
Me.RecordsetType = adOpenDynamic
If blnConnectSub Then
Me.sub_frm_artist.LinkChildFields = "artist id"
Me.sub_frm_artist.LinkMasterFields = "artist id"
End If
End Sub
vwCollectionNoPic is a view that is based on one table, no joins. Under
form properties, the unique table is set to "Collection" and the resync is
"Select * From vwCollecionNoPic Where artist_id = ?" The form has two
subforms on it. One displays information about the artist from the artist
table. The other uses code to populate a recordset with a server filter.
The recordset simply contains the collection's primary key field,
"catalogue_number" and a picture field. I structured it this way so that
only one picture is loaded at a time.
strSQL = "SELECT [Villanova Catalogue Number],picture FROM vwPicOnly
WHERE " _
& "[villanova catalogue number] = '" & [Villanova Catalogue Number]
& "';"
recPic.Open strSQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
Set frmSub = Forms!frm_main_collection!sub_frm_pic.Form
If Not IsNull(recPic("Picture")) Then
Me.sub_frm_pic.Enabled = True
strServerFilter = "[villanova catalogue number] = '" &
Me.Villanova_Catalogue_Number & "'"
frmSub.ServerFilter = strServerFilter
frmSub.RecordSource = "Select * From vwPicOnly"
Else
frmSub.RecordSource = ""
Me.sub_frm_pic.Enabled = False
End If
If anyone needs any additional information to help me solve this, I'm happy
to provide it.
Thanks in advance!
Andrea
This all seems to work fine except that the data that populates the form is
read only. When you try to edit the data you get "Field 'fieldname' is based
on an expression and can't be edited."