Hello all,
I have defined a public variable at module level :
Public sSchrijver As String
Then, in the first form's combobox I assign a value to it :
Private Sub Kiesschrijver_C hange()
If IsNull(Me!Kiess chrijver.Value) Then
sSchrijver = ""
Else
sSchrijver = Nz(Trim(Me!Kies schrijver.Value ))
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmSchrijfbrie f"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub
Then, when the second form (frmSchrijfbrie f) opens, I define this form's
recordsource like this :
Private Sub Form_Open(Cance l As Integer)
Me.RecordSource = "select * from tblMwerkers where volledigenaam =
sSchrijver"
End Sub
When running the whole thing I am being asked for a value for sSchrijver,
like when you run a parameter query, although the value for sSchrijver has
already been defined in the Kiesschrijver_C hange() event ....
Can somebody tell me what I am doing wrong ?
Any help very much appreciated !
Thanks
Ronny Sigo 3 1844
"Ronny Sigo" <ro********@sky net.be> wrote in message
news:3f******** **************@ reader2.news.sk ynet.be... Hello all, I have defined a public variable at module level : Public sSchrijver As String
Then, in the first form's combobox I assign a value to it : Private Sub Kiesschrijver_C hange() If IsNull(Me!Kiess chrijver.Value) Then sSchrijver = "" Else sSchrijver = Nz(Trim(Me!Kies schrijver.Value )) Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmSchrijfbrie f" DoCmd.OpenForm stDocName, , , stLinkCriteria End If
End Sub Then, when the second form (frmSchrijfbrie f) opens, I define this form's recordsource like this :
Private Sub Form_Open(Cance l As Integer) Me.RecordSource = "select * from tblMwerkers where volledigenaam = sSchrijver" End Sub
When running the whole thing I am being asked for a value for sSchrijver, like when you run a parameter query, although the value for sSchrijver has already been defined in the Kiesschrijver_C hange() event ....
Can somebody tell me what I am doing wrong ?
Any help very much appreciated ! Thanks Ronny Sigo
sSchrijver is a string so you need quotes around it.
Try this:
Private Sub Form_Open(Cance l As Integer)
Dim strSQL As String
strSQL = "select * from tblMwerkers where volledigenaam=" ""
strSQL = strSQL & sSchrijver & """"
Me.RecordSource = strSQL
End Sub
Ronny, Public sSchrijver As String
For this operation you don't need sSchrijver.
Private Sub Kiesschrijver_C hange()
Dim stDocName As String
Dim stLinkCriteria As String
If Nz(Me!Kiesschri jver.Value,"") <>"" Then
stDocName = "frmSchrijfbrie f"
stLinkCriteria = "volledigen aam = '" & _
Me!Kiesschrijve r.Value & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub
Private Sub Form_Open(Cance l As Integer) Me.RecordSource = "select * from tblMwerkers where volledigenaam = sSchrijver" End Sub
Remove these lines.
HTH - Peter
--
No mails please.
Thanks guys :)
"Ronny Sigo" <ro********@sky net.be> wrote in message
news:3f******** **************@ reader2.news.sk ynet.be... Hello all, I have defined a public variable at module level : Public sSchrijver As String This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Shufen |
last post by:
Hi,
I'm a newbie that just started to learn python, html and etc. I have
some questions to ask and hope that someone can help me on.
I'm trying to code a python script (with HTML) to get values from a
html form that consists of about 10 checkbox and a textbox where user
have to key in a value to perform a search.
From python tutors, I learned that I have to use the following method:
|
by: Don |
last post by:
Via JavaScript within the client page containing the checkbox, I'm trying to capture the value of a
checkbox to make a cookie out of it. But, all I get is the defined "ON" value, even when it is
unchecked. I'm using the following construct:
document.cookie = "cpceRememberLoginCookie="+document.getPage1.rememberLogin.value+"; expires=Thr,
01-Jan-2015 00:00:00 GMT";
The actual checkbox value passed in the <form> POST reflects the actual...
|
by: cmc_dermo |
last post by:
I have a form that has a select list.
A user chooses a value and the page refreshes showing the selected
value in the dropdown box.
So I want to use Javascript to get the selected query from the form.
I then want to pass it as a hidden field.
So for example the section of the page I'm interested in will look like
|
by: Cherrish Vaidiyan |
last post by:
Frinds,
Hope everyone is doing fine.i feel pointers to be the most toughest
part in C. i have just completed learning pointers & arrays related
portions. I need to attend technical interview on C. wat type of
questions should be expected? Which part of C language do the staff
give more concern?
The interviewers have just mentioned that .. i will have interview on
C.
Also can anyone can help me with sites where i can go thru sample
|
by: Jatinder |
last post by:
I 'm a professional looking for the job.In interview these questions
were asked with some others which I answered.But some of them left
unanswered.Plz help.
Here are some questions on C/C++, OS internals?
Q1 . What is the use of pointer to an array?
Q2 . What is the use of array of pointers?
Q3 . What is the use of pointer to function ?
Q4 . How to print through serial port? What is Flow Control(Xon,Xoff)
?
| |
by: ajikoe |
last post by:
Hello,
I used Visual C# Standard Edition.
I want to comment my program using xml commentary method,
I don't know why if I use value and example tag, it is not working / showed in the html result.
for example I have Property
///<value>this is in description</value>
///<example>this is in Example</example>
public int A{
|
by: FAQ server |
last post by:
-----------------------------------------------------------------------
FAQ Topic - How do I get the value of a form control?
-----------------------------------------------------------------------
In HTML documents, named forms may be referred to as named
properties of the « document.forms » collection, and named form
controls may be referred to as named properties of the form's
elements collection:
var frm = document.forms;
|
by: yoursteveis |
last post by:
Dear all,
I have created a main report (for monthly purchase summary) and a sub report (for monthly sales summary).
I have linked main report with a parameter query (i.e. purchasesummary1) and I have linked the sub report with another parameter query (i.e salessummary2)
when i open main report and sub report separately, they asked me the parameter value once only but when I unite them in a single report (i.e. main report + sub report)...
|
by: Astley Le Jasper |
last post by:
Sorry for the numpty question ...
How do you find the reference name of an object?
So if i have this
bob = modulename.objectname()
how do i find that the name is 'bob'
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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...
| |
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...
|
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...
|
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...
|
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();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |