473,413 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Assign LinkChildFields property into VBA Access97

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
2 4756
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Eric | last post by:
How can I dynamically assign an event to an element? I have tried : (myelement is a text input) document.getElementById('myelement').onKeyUp = "myfnc(param1,param2,param3)"; ...
1
by: Saintor | last post by:
I have a form with a tab control. Many recordset that I turn on/off with the tab change property. I set the LinkChildFields and LinkMasterFields at this time. However, if there is no record in...
3
by: Mark | last post by:
Access97 --- I set the Required property for a field at the table level and I have a form that contains that field. When I click the Close button at the top left of the screen, I get an error...
1
by: Mario Crevits | last post by:
My name is Mario Crevits, I'm from Belgium (Roeselare) and I'm working with Access97 for several years now. We are in an Access97-2000 migration project. I'm writing a wizard for the end-users to...
2
by: dBNovice | last post by:
Hi all! I have 3 separate forms: Tasks, Subtasks, and Elements. All 3 is related by TaskId and Subtasks and Elements are related by SubtaskID. In the DB after I add a task, I want to be able to...
6
by: david | last post by:
I try to use "for" loop to retrieve and assign values in web form. The code is in the following. But it can not be compiled. What I want to do is: txtQ1.Text =...
1
by: IamKJVonly | last post by:
I have office 97 which includes access97 and have built many access97 databases and use VB4 as the front end. I have just gotten a new computer which has 1 gig of memory on it and when I try to...
2
by: Venkatesh | last post by:
Hello all, We have a micro site that is getting opened inside a popup window from some external main site (the domains of our microsite and main site are different) ... I need to support the...
3
by: Ramchandar | last post by:
Hi, I am creating reports using VBA code. I have the same query in a querydef residing both in Access97 and Access2003. The result of this querydef is then moved to a table in Access97 and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.