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

Assign LinkChildFields property into VBA Access97

P: n/a
Sorry in advance for my english. :-)

I have a form MS Access97 with two subforms. These subforms have different
data and dimensions, if into the main form I've selected with checkbox "Date
of delivery" instead "Item".

To select the right subforms I make use of this sub:

************************************************** ***
Private Sub opzSelezione_AfterUpdate()

Me!sfrmSelezione.Visible = False
Me!DescrDatoSelez.Visible = False
Me!sfrmDettaglioSel.Visible = False

Select Case Me!opzSelezione
Case 1 '*** Data consegna
'Sotto maschera Selezione
With Me!sfrmSelezione
.Width = 1700
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_SelDate"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSelez
.Width = 9291
.Height = 288
.top = 113
.left = 1984
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettaglioSel
.Width = 9306
.Height = 4994
.top = 623
.left = 1979
.SourceObject = "Sk_ProdInCons_DateDett"
.LinkChildFields = ""
.LinkMasterFields = ""
.LinkChildFields = "DataPrevArrivo" ' = Date of
delivery
.LinkMasterFields = "DatoSelezionato"
.LinkChildFields = "DataPrevArrivo"
End With
Case 2 '*** Prodotto
'Sotto maschera Selezione
With Me!sfrmSelezione
.Width = 4535
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_SelProd"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSelez
.Width = 6591
.Height = 288
.top = 113
.left = 4694
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettaglioSel
.Width = 6591
.Height = 4994
.top = 623
.left = 4699
.SourceObject = "Sk_ProdInCons_ProdDett"
.LinkChildFields = ""
.LinkMasterFields = ""
.LinkChildFields = "Prodotto" 'Item
.LinkMasterFields = "DatoSelezionato"
End With
End Select

Me!sfrmSelezione.Visible = True
Me!DescrDatoSelez.Visible = True
Me!sfrmDettaglioSel.Visible = True

Me!sfrmSelezione.SetFocus

End Sub
************************************************** ****

The default select is "Date of delivery", but when I select "Item" I receive

"Run-time error '2101'
The setting you entered isn't valid for this property."

The error occurring at the line ".LinkChildFields = "Prodotto" ' = Item
"

When the msgbox appear I click on then button of Debug and, if I repeat the
execution of the line ".SourceObject = "Sk_ProdInCons_DateDett" ",
next time then line ".LinkChildFields = "Prodotto" ' = Item " will be
execute correctly and I can see the right subform.

I don't know with sometimes my program works perfectly

Anyone can help me?

Thanks

Eugenio

Jan 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Don't use LinkChildFields.

Use RecordSource. Change RecordSource to select record.

If you use LinkChildFields, make the fields the same name.

.SourceObject = "Sk_ProdInCons_DateDett"
.SourceObject = "Sk_ProdInCons_DateDett"
.form.recordsource = .form.recordsource
.form.recordsource = .form.recordsource
.LinkChildFields = ""
.LinkMasterFields = ""
.LinkChildFields = "DataChild"

Set the SourceObject and the RecordSource twice.

Don't use LinkChildFields.

Use RecordSource. Change RecordSource to select record.

(david)

"Eugenio" <ep******@tiscali.it> wrote in message
news:43********************@news.tiscali.it...
Sorry in advance for my english. :-)

I have a form MS Access97 with two subforms. These subforms have different
data and dimensions, if into the main form I've selected with checkbox
"Date
of delivery" instead "Item".

To select the right subforms I make use of this sub:

************************************************** ***
Private Sub opzSelezione_AfterUpdate()

Me!sfrmSelezione.Visible = False
Me!DescrDatoSelez.Visible = False
Me!sfrmDettaglioSel.Visible = False

Select Case Me!opzSelezione
Case 1 '*** Data consegna
'Sotto maschera Selezione
With Me!sfrmSelezione
.Width = 1700
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_SelDate"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSelez
.Width = 9291
.Height = 288
.top = 113
.left = 1984
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettaglioSel
.Width = 9306
.Height = 4994
.top = 623
.left = 1979
.SourceObject = "Sk_ProdInCons_DateDett"
.LinkChildFields = ""
.LinkMasterFields = ""
.LinkChildFields = "DataPrevArrivo" ' = Date of
delivery
.LinkMasterFields = "DatoSelezionato"
.LinkChildFields = "DataPrevArrivo"
End With
Case 2 '*** Prodotto
'Sotto maschera Selezione
With Me!sfrmSelezione
.Width = 4535
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_SelProd"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSelez
.Width = 6591
.Height = 288
.top = 113
.left = 4694
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettaglioSel
.Width = 6591
.Height = 4994
.top = 623
.left = 4699
.SourceObject = "Sk_ProdInCons_ProdDett"
.LinkChildFields = ""
.LinkMasterFields = ""
.LinkChildFields = "Prodotto" 'Item
.LinkMasterFields = "DatoSelezionato"
End With
End Select

Me!sfrmSelezione.Visible = True
Me!DescrDatoSelez.Visible = True
Me!sfrmDettaglioSel.Visible = True

Me!sfrmSelezione.SetFocus

End Sub
************************************************** ****

The default select is "Date of delivery", but when I select "Item" I
receive

"Run-time error '2101'
The setting you entered isn't valid for this property."

The error occurring at the line ".LinkChildFields = "Prodotto" ' = Item
"

When the msgbox appear I click on then button of Debug and, if I repeat
the
execution of the line ".SourceObject = "Sk_ProdInCons_DateDett" ",
next time then line ".LinkChildFields = "Prodotto" ' = Item " will be
execute correctly and I can see the right subform.

I don't know with sometimes my program works perfectly

Anyone can help me?

Thanks

Eugenio

Jan 23 '06 #2

P: n/a
Thanks David

I resolved. The problem was very stupid. I defined the field
"DatoSelezionato" (LinkMasterFields) not visible.
Now the program works perfectly.

Ciao
Eugenio
Don't use LinkChildFields.

Use RecordSource. Change RecordSource to select record.

If you use LinkChildFields, make the fields the same name.

.SourceObject = "Sk_ProdInCons_DateDett"
.SourceObject = "Sk_ProdInCons_DateDett"
.form.recordsource = .form.recordsource
.form.recordsource = .form.recordsource
.LinkChildFields = ""
.LinkMasterFields = ""
.LinkChildFields = "DataChild"

Set the SourceObject and the RecordSource twice.

Don't use LinkChildFields.

Use RecordSource. Change RecordSource to select record.

(david)

"Eugenio" <ep******@tiscali.it> wrote in message
news:43********************@news.tiscali.it...
Sorry in advance for my english. :-)

I have a form MS Access97 with two subforms. These subforms have different data and dimensions, if into the main form I've selected with checkbox
"Date
of delivery" instead "Item".

To select the right subforms I make use of this sub:

************************************************** ***
Private Sub opzSelezione_AfterUpdate()

Me!sfrmSelezione.Visible = False
Me!DescrDatoSelez.Visible = False
Me!sfrmDettaglioSel.Visible = False

Select Case Me!opzSelezione
Case 1 '*** Data consegna
'Sotto maschera Selezione
With Me!sfrmSelezione
.Width = 1700
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_SelDate"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSelez
.Width = 9291
.Height = 288
.top = 113
.left = 1984
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettaglioSel
.Width = 9306
.Height = 4994
.top = 623
.left = 1979
.SourceObject = "Sk_ProdInCons_DateDett"
.LinkChildFields = ""
.LinkMasterFields = ""
.LinkChildFields = "DataPrevArrivo" ' = Date of
delivery
.LinkMasterFields = "DatoSelezionato"
.LinkChildFields = "DataPrevArrivo"
End With
Case 2 '*** Prodotto
'Sotto maschera Selezione
With Me!sfrmSelezione
.Width = 4535
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_SelProd"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSelez
.Width = 6591
.Height = 288
.top = 113
.left = 4694
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettaglioSel
.Width = 6591
.Height = 4994
.top = 623
.left = 4699
.SourceObject = "Sk_ProdInCons_ProdDett"
.LinkChildFields = ""
.LinkMasterFields = ""
.LinkChildFields = "Prodotto" 'Item .LinkMasterFields = "DatoSelezionato"
End With
End Select

Me!sfrmSelezione.Visible = True
Me!DescrDatoSelez.Visible = True
Me!sfrmDettaglioSel.Visible = True

Me!sfrmSelezione.SetFocus

End Sub
************************************************** ****

The default select is "Date of delivery", but when I select "Item" I
receive

"Run-time error '2101'
The setting you entered isn't valid for this property."

The error occurring at the line ".LinkChildFields = "Prodotto" ' = Item "

When the msgbox appear I click on then button of Debug and, if I repeat
the
execution of the line ".SourceObject = "Sk_ProdInCons_DateDett" ",
next time then line ".LinkChildFields = "Prodotto" ' = Item " will be execute correctly and I can see the right subform.

I don't know with sometimes my program works perfectly

Anyone can help me?

Thanks

Eugenio


Jan 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.