473,791 Members | 3,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I am being asked for a value when I don't want to ....

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

Nov 12 '05 #1
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


Nov 12 '05 #2
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.
Nov 12 '05 #3
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


Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6174
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:
7
2943
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...
5
1886
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
56
4344
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
50
4379
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) ?
11
2655
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{
17
479
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;
1
2090
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)...
275
12410
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'
0
9669
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, 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...
0
10428
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
10207
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
9997
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
7537
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
6776
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
5435
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...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3718
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.