473,414 Members | 1,596 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,414 software developers and data experts.

Dynamic Linkmasterfields

Hie

I have an unbound form on which there are 3 controls: option group, combo box and a subform. The value of the combo box depends on the value of the option group and the value of link child field depends on the value of the combo box. here is the code:
Expand|Select|Wrap|Line Numbers
  1. Dim stSQL As String, stCriteria As String, stDocNo As String
  2.  
  3. stDocNo = Me.cboDocNo
  4.  
  5. If Frame4.Value = 1 Then
  6.     stSQL = "SELECT [DeliveryNotes].[DeliveryNote], [DeliveryNotes].[Consignee], [DeliveryNotes].[Description], "
  7.     stSQL = stSQL & "[DeliveryNotes].[ClientID] FROM [DeliveryNotes]"
  8. Else
  9.     stSQL = "SELECT [ExpiryDates].[ItemTransID], [ExpiryDates].[InvoiceNo], [ExpiryDates].[Description] "
  10.     stSQL = stSQL & "FROM [ExpiryDates]"
  11. End If
  12.  
  13. Me.cboDocNo.RowSource = stSQL
  14. Me.DeliveryTrans.LinkMasterFields = stDocNo
  15. If Frame4.Value = 1 Then
  16.     Me.DeliveryTrans.LinkChildFields = "[DeliveryNoteNo]"
  17. Else
  18.     Me.DeliveryTrans.LinkChildFields = "[InvoiceNo]"
  19. End If
  20.  
  21. Me.cboDocNo.Requery
This code is set to run when the option group is updated but I'm getting a runtime error. I'm actually prompted for a parameter value. If the value of the combop box (stDocNo) is, for example, 5 I'm prompted for a parameter value of 5. If I haven't entered anything yet I get "Invalid use of null" error. Is there something I'm missing? Please help.

Regards

Liveson
Nov 18 '08 #1
1 2615
would a discrepancy in name be an issue

Me.DeliveryTrans.LinkChildFields = "[DeliveryNoteNo]"


stSQL = "SELECT [DeliveryNotes].[DeliveryNote],


jo
Nov 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Roel Wuyts | last post by:
CALL FOR CONTRIBUTIONS International Workshop on Revival of Dynamic Languages http://pico.vub.ac.be/~wdmeuter/RDL04/index.html (at OOPSLA2004, Vancouver, British Columbia, Canada, October...
0
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab,...
3
by: jaLe | last post by:
This problem was discussed before but it doesn't solve my situation I have master table Generalije with PK: ID1 I added subdatasheet table Nalaz with field FK GeneralijeID When I add new...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
7
by: jgoodnight | last post by:
Hello, I've read through many forum posts on this issue today but can't seem to find a solution that fits my particular case. I have three main tables: - tblIssues (PK: IssueID) -...
5
by: bearophileHUGS | last post by:
I often use Python to write small programs, in the range of 50-500 lines of code. For example to process some bioinformatics data, perform some data munging, to apply a randomized optimization...
1
geolemon
by: geolemon | last post by:
I have a form/subform used for inventory management. It is a bound form. The error: I don't understand what this means. How the form is intended to work: When you select a part number in...
17
by: eranil84 | last post by:
I get this "The LinkMasterFields Property setting has produced this error: 'A problem occurred while Microsoft Office Access was communicating with the OLE server or ActiveX Control' " error message...
3
EJaques
by: EJaques | last post by:
Hello, I have a list box that controls the display of information on a form and its subform. I am having problems with the code to change Child/Parent links according to what is selected in the...
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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.