473,761 Members | 10,684 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Af terUpdate()

Me!sfrmSelezion e.Visible = False
Me!DescrDatoSel ez.Visible = False
Me!sfrmDettagli oSel.Visible = False

Select Case Me!opzSelezione
Case 1 '*** Data consegna
'Sotto maschera Selezione
With Me!sfrmSelezion e
.Width = 1700
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_ SelDate"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSel ez
.Width = 9291
.Height = 288
.top = 113
.left = 1984
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettagli oSel
.Width = 9306
.Height = 4994
.top = 623
.left = 1979
.SourceObject = "Sk_ProdInCons_ DateDett"
.LinkChildField s = ""
.LinkMasterFiel ds = ""
.LinkChildField s = "DataPrevArrivo " ' = Date of
delivery
.LinkMasterFiel ds = "DatoSelezionat o"
.LinkChildField s = "DataPrevArrivo "
End With
Case 2 '*** Prodotto
'Sotto maschera Selezione
With Me!sfrmSelezion e
.Width = 4535
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_ SelProd"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSel ez
.Width = 6591
.Height = 288
.top = 113
.left = 4694
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettagli oSel
.Width = 6591
.Height = 4994
.top = 623
.left = 4699
.SourceObject = "Sk_ProdInCons_ ProdDett"
.LinkChildField s = ""
.LinkMasterFiel ds = ""
.LinkChildField s = "Prodotto" 'Item
.LinkMasterFiel ds = "DatoSelezionat o"
End With
End Select

Me!sfrmSelezion e.Visible = True
Me!DescrDatoSel ez.Visible = True
Me!sfrmDettagli oSel.Visible = True

Me!sfrmSelezion e.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 ".LinkChildFiel ds = "Prodotto" ' = Item
"

When the msgbox appear I click on then button of Debug and, if I repeat the
execution of the line ".SourceObj ect = "Sk_ProdInCons_ DateDett" ",
next time then line ".LinkChildFiel ds = "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 4787
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.recordsou rce = .form.recordsou rce
.form.recordsou rce = .form.recordsou rce
.LinkChildField s = ""
.LinkMasterFiel ds = ""
.LinkChildField s = "DataChild"

Set the SourceObject and the RecordSource twice.

Don't use LinkChildFields .

Use RecordSource. Change RecordSource to select record.

(david)

"Eugenio" <ep******@tisca li.it> wrote in message
news:43******** ************@ne ws.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_Af terUpdate()

Me!sfrmSelezion e.Visible = False
Me!DescrDatoSel ez.Visible = False
Me!sfrmDettagli oSel.Visible = False

Select Case Me!opzSelezione
Case 1 '*** Data consegna
'Sotto maschera Selezione
With Me!sfrmSelezion e
.Width = 1700
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_ SelDate"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSel ez
.Width = 9291
.Height = 288
.top = 113
.left = 1984
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettagli oSel
.Width = 9306
.Height = 4994
.top = 623
.left = 1979
.SourceObject = "Sk_ProdInCons_ DateDett"
.LinkChildField s = ""
.LinkMasterFiel ds = ""
.LinkChildField s = "DataPrevArrivo " ' = Date of
delivery
.LinkMasterFiel ds = "DatoSelezionat o"
.LinkChildField s = "DataPrevArrivo "
End With
Case 2 '*** Prodotto
'Sotto maschera Selezione
With Me!sfrmSelezion e
.Width = 4535
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_ SelProd"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSel ez
.Width = 6591
.Height = 288
.top = 113
.left = 4694
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettagli oSel
.Width = 6591
.Height = 4994
.top = 623
.left = 4699
.SourceObject = "Sk_ProdInCons_ ProdDett"
.LinkChildField s = ""
.LinkMasterFiel ds = ""
.LinkChildField s = "Prodotto" 'Item
.LinkMasterFiel ds = "DatoSelezionat o"
End With
End Select

Me!sfrmSelezion e.Visible = True
Me!DescrDatoSel ez.Visible = True
Me!sfrmDettagli oSel.Visible = True

Me!sfrmSelezion e.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 ".LinkChildFiel ds = "Prodotto" ' = Item
"

When the msgbox appear I click on then button of Debug and, if I repeat
the
execution of the line ".SourceObj ect = "Sk_ProdInCons_ DateDett" ",
next time then line ".LinkChildFiel ds = "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
"DatoSelezionat o" (LinkMasterFiel ds) 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.recordsou rce = .form.recordsou rce
.form.recordsou rce = .form.recordsou rce
.LinkChildField s = ""
.LinkMasterFiel ds = ""
.LinkChildField s = "DataChild"

Set the SourceObject and the RecordSource twice.

Don't use LinkChildFields .

Use RecordSource. Change RecordSource to select record.

(david)

"Eugenio" <ep******@tisca li.it> wrote in message
news:43******** ************@ne ws.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_Af terUpdate()

Me!sfrmSelezion e.Visible = False
Me!DescrDatoSel ez.Visible = False
Me!sfrmDettagli oSel.Visible = False

Select Case Me!opzSelezione
Case 1 '*** Data consegna
'Sotto maschera Selezione
With Me!sfrmSelezion e
.Width = 1700
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_ SelDate"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSel ez
.Width = 9291
.Height = 288
.top = 113
.left = 1984
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettagli oSel
.Width = 9306
.Height = 4994
.top = 623
.left = 1979
.SourceObject = "Sk_ProdInCons_ DateDett"
.LinkChildField s = ""
.LinkMasterFiel ds = ""
.LinkChildField s = "DataPrevArrivo " ' = Date of
delivery
.LinkMasterFiel ds = "DatoSelezionat o"
.LinkChildField s = "DataPrevArrivo "
End With
Case 2 '*** Prodotto
'Sotto maschera Selezione
With Me!sfrmSelezion e
.Width = 4535
.Height = 5490
.top = 113
.left = 56
.SourceObject = "Sk_ProdInCons_ SelProd"
End With
'Descrizione Dato Selezionato
With Me!DescrDatoSel ez
.Width = 6591
.Height = 288
.top = 113
.left = 4694
End With
'Sotto maschera Dettaglio Selezione
With Me!sfrmDettagli oSel
.Width = 6591
.Height = 4994
.top = 623
.left = 4699
.SourceObject = "Sk_ProdInCons_ ProdDett"
.LinkChildField s = ""
.LinkMasterFiel ds = ""
.LinkChildField s = "Prodotto" 'Item .LinkMasterFiel ds = "DatoSelezionat o"
End With
End Select

Me!sfrmSelezion e.Visible = True
Me!DescrDatoSel ez.Visible = True
Me!sfrmDettagli oSel.Visible = True

Me!sfrmSelezion e.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 ".LinkChildFiel ds = "Prodotto" ' = Item "

When the msgbox appear I click on then button of Debug and, if I repeat
the
execution of the line ".SourceObj ect = "Sk_ProdInCons_ DateDett" ",
next time then line ".LinkChildFiel ds = "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
12579
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)"; document.getElementById('myelement') = new Function("myfnc(param1,param2,param3)");
1
3380
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 the subform, I will get an error; "Index or primary key can't contain a Null value". By playing with the sub form err, I have determined that it is 3058. But I can not trap it, in both the main form or the subform. I have tried open, load,...
3
3016
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 message when the field is blank and Access will not let me save the record. However, I also have a Close command button with the code: DoCmd.Close When I click the button, the form closes with no error message although the field is blank. I tried...
1
2649
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 automatically find and convert their Access97 databases on a specific drive. I want to convert the databases through VBA : 1. create an empty Access2000 2. set the right properties and references 3. import the objects (tables, queries,...
2
2991
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 add one or more subtasks and then one or more elements. I need the subtasks and elements to be have the same taskid as the task; also I want the element to have the same subtaskId as the subtask. I have been able to design the system to include...
6
2277
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 = ds.Tables("mmsSpecRecord").Rows(0)("Q1") txtQ2.Text = ds.Tables("mmsSpecRecord").Rows(0)("Q2") ..... txtQ10.Text = ds.Tables("mmsSpecRecord").Rows(0)("Q10") ------code ------- Dim field As String = "Q"
1
1844
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 install office 97 on it. everything installs ok execpt access97 won't run. I have since tried it on another machine and it seems to be a memory problem. If the computer's memory is more than 512megs. then access97 won't run. Is there a patch or...
2
2928
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 following functionality: After the user is done surfing the pages on our site and user clicks the close hyperlink (present on top of all of our webpages), the opener window's location needs to be reset to some given URL ....
3
1960
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 Access2003 respectively. The table in Access97 returns 874 rowcount, table in Access 2003 returns 1050 rowcount. In both the case the querydef is retrieving from the same database which resides in SQL Server 2003. I executed the application Access97 and...
0
9333
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9945
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9765
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7324
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6599
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3863
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3442
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.