No one has asked the most obvious question: Why do you want to try to use this code? What is it you're trying to accomplish?
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
(Paris, France)
On Feb 23, 2017, at 2:34 PM, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
it doesn't work.
didn't get the expected results
didn't get the expected results
But this doesn't provide much. What are you seeing that we can't and you think is wrong?
Regards,
Duane
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of 'Kevin Z.' qingqinga@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Thursday, February 23, 2017 4:39 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to call this function from forms.
Sent: Thursday, February 23, 2017 4:39 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to call this function from forms.
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of 'Kevin Z.' qingqinga@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Thursday, February 23, 2017 4:24 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to call this function from forms.
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of qingqinga qingqinga@yahoo.com[MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Thursday, February 23, 2017 2:21 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to call this function from forms.Duane-
Yes, I tried "", it works as default value as "HotelID". I also tried blank, it doesn't work.
Best Regards,
Kevin
发自我的小米手机在 "Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>,2017年2月23日 15:58写道:
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of 'Kevin Z.' qingqinga@yahoo.com[MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Wednesday, February 22, 2017 11:31 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to call this function from forms.
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of 'Kevin Z.' qingqinga@yahoo.com[MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Wednesday, February 22, 2017 5:58 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to call this function from forms.
Duane-Here's the code. There's no space in the linking field names.
Private Sub Command2_Click()On Error GoTo ErrHandle
linkSubForm Me, "subFormFrame", "HotelID", "HotelID", , "subHotelContact"
ErrExit:Exit SubErrHandle:Resume ErrExit
End Sub
Best Regards,Kevin
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of 'Kevin Z.' qingqinga@yahoo.com[MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Wednesday, February 22, 2017 4:24 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to call this function from forms.
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of 'Kevin Z.' qingqinga@yahoo.com[MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Wednesday, February 22, 2017 2:47 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to call this function from forms.
Regards,linkSubForm Me, "subFormFrame", "HotelID", "HotelID", , "subHotelContact"
Duane HookomVevey, Switzerland
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of 'Kevin Z.' qingqinga@yahoo.com[MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Wednesday, February 22, 2017 2:00 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to call this function from forms.
The code in your post was a bit garbled in my IN BOX so I have reformatted and added a couple lines of comments' call from a main form with code like' linkSubForm Me, "sfrmMySfName", "EmployeeID", "EmployeeID"
If you provided some actual subform control and object names as well as the linking fields, we could help a bit more.
Option Compare DatabaseOption ExplicitPublic bolLinkSubForm As Boolean'Global durch Public ersetzt by Willi Wipp' Author : Christian Coppes' Version: V1.3' Last Modified: 29.06.2007' ' Update link to a subform (name in "strSubform")' strChild and strMaster = Indices which should be linked' between main form and subform.' Name of the subform and name of the subform-container must be identical,' if strSubForm is leftPublic Sub linkSubForm(frm As Form, strSubFormContainer As String, _strChild As String, strMaster As String, _Optional strRecSource As String, _Optional strSubForm As String)' call from a main form with code like' linkSubForm Me, "sfrmMySfName", "EmployeeID", "EmployeeID"On Error GoTo FehlerbolLinkSubForm = TrueApplication.Echo FalseIf strSubForm = "" ThenstrSubForm = strSubFormContainer ' necessary following MS-instructionsfrm(strSubFormContainer).LinkChildFields = "" ' necessary following MS-instructionsfrm(strSubFormContainer).LinkMasterFields = ""frm(strSubFormContainer).SourceObject = strSubFormIf (strChild <> "" And strMaster <> "") Thenfrm(strSubFormContainer).LinkChildFields = strChildfrm(strSubFormContainer).LinkMasterFields = strMasterEnd IfIf strRecSource <> "" Thenfrm(strSubFormContainer).Form.RecordSource = strRecSourceEnd IfApplication.Echo TruebolLinkSubForm = FalseExit Sub Fehler:Application.Echo TrueSelect Case Err.NumberCase Else MsgBox "Error in linkSubForm: " & vbCr & Err.Description & vbCr & _ " Number: " & Str(Err.Number)Resume NextEnd SelectEnd SubRegards,
Duane HookomVevey, Switzerland
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of 'qingqinga@yahoo.com' qingqinga@yahoo.com[MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, February 21, 2017 10:31 PM
To: MS_Access_Professionals
Subject: [MS_AccessPros] How to call this function from forms.
Dear All,
I got this code below from a website. Can anybody give me an example on how to call this function from forms. Thanks in advance.
Option Compare Database Option Explicit Public bolLinkSubForm As Boolean 'Global durch Public ersetzt by Willi Wipp ' Author : Christian Coppes ' Version: V1.3 ' Last Modified: 29.06.2007 ' ' Update link to a subform (name in "strSubform") ' strChild and strMaster = Indices which should be linked ' between main form and subform. ' Name of the subform and name of the subform-container must be identical, ' if strSubForm is left Public Sub linkSubForm(frm As Form, strSubFormContainer As String, _ strChild As String, strMaster As String, _ Optional strRecSource As String, _ Optional strSubForm As String) On Error GoTo Fehler bolLinkSubForm = True Application.Echo False If strSubForm = "" Then strSubForm = strSubFormContainer ' necessary following MS-instructions frm(strSubFormContainer).LinkChildFields = "" ' necessary following MS-instructions frm(strSubFormContainer).LinkMasterFields = "" frm(strSubFormContainer).SourceObject = strSubForm If (strChild <> "" And strMaster <> "") Then frm(strSubFormContainer).LinkChildFields = strChild frm(strSubFormContainer).LinkMasterFields = strMaster End If If strRecSource <> "" Then frm(strSubFormContainer).Form.RecordSource = strRecSource End If Application.Echo True bolLinkSubForm = False Exit Sub Fehler: Application.Echo True Select Case Err.Number Case Else MsgBox "Error in linkSubForm: " & vbCr & Err.Description & vbCr & _ " Number: " & Str(Err.Number) Resume Next End Select End SubBest Regards,Kevin
__._,_.___
Posted by: John Viescas <johnv@msn.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (22) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar