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

How to prevent the Enter Parameter pop up?

Hi,

I modified a code for a search form to open a form for a specific criteria as one of the search fields was not working. Now it works but the problem is I get the Enter Parameter pop up for Date; time! Here is the code:
Dim stDocName As String
Dim stLinkCriteria As String

stLinkCriteria = ""
If Trim(txtcustname) <> "" Then
stLinkCriteria = "[customer]=" & Me![txtcustname]
End If
If Trim(txtterms) <> "" Then
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = stLinkCriteria + " And "
End If
stLinkCriteria = stLinkCriteria + "[terms#]='" + Trim(UCase(txtterms)) + "'"
End If
If Trim(txtrma) <> "" Then
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = stLinkCriteria + " And "
End If
stLinkCriteria = stLinkCriteria + "[rma#] = '" + Trim(UCase(txtrma)) + "'"
End If
If Trim(txtintrma) <> "" Then
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = stLinkCriteria + " And "
End If
stLinkCriteria = stLinkCriteria + "[internalrma] = '" + Trim(UCase(txtintrma)) + "'"
End If
If Trim(txtpo) <> "" Then
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = stLinkCriteria + " And "
End If
stLinkCriteria = stLinkCriteria + "[po#]='" + Trim(UCase(txtpo)) + "'"
End If
If Trim(txtmemo) <> "" Then
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = stLinkCriteria + " And "
End If
stLinkCriteria = stLinkCriteria + "[creditmemo]='" + Trim(UCase(txtmemo)) + "'"
stDocName = "frm_find-memo"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.close acForm, "frm_detail-find"
Exit Sub
End If
If Trim(txtquote) <> "" Then
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = stLinkCriteria + " And "
End If
stLinkCriteria = stLinkCriteria + "[quote#]='" + Trim(UCase(txtquote)) + "'"
End If
If Trim(txtway) <> "" Then
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = stLinkCriteria + " And "
End If
stLinkCriteria = stLinkCriteria + "[waybill#] = '" + Trim(UCase(txtway)) + "'"
stLinkCriteria = stLinkCriteria + " And "
stLinkCriteria = stLinkCriteria + "[courier] = '" + Trim(UCase(txtcourier)) + "'"
stDocName = "frm_find-part-detail"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.close acForm, "frm_detail-find"
Exit Sub
End If
stDocName = "frm_r"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.close acForm, "frm_detail-find"

Exit_search_Click:
Exit Sub

Can anyone tell what is wrong with it? Here is the modification I added:
stLinkCriteria = ""
If Trim(txtcustname) <> "" Then
stLinkCriteria = "[customer]=" & Me![txtcustname]
End If
the customer field is numeric and the txtcustname is a combo box showing the name of the customer but the bound column is the ID of the customer so both are numeric...Can anyone help!
Thanks

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
8 3060
"Abby B via AccessMonster.com" <fo***@AccessMonster.com> wrote:
I modified a code for a search form to open a form for a specific
criteria as one of the search fields was not working. Now it works but
the problem is I get the Enter Parameter pop up for Date; time!


Were the hashes (#) in the original code? Hashes are used to delimit
date/time data types in SQL. Your field names would tend to suggest that
they are not date/time data types.

Also, this:

stLinkCriteria = stLinkCriteria + " And "

looks a little odd - shouldn't that "+" be "&"?

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #2
Thanks for your reply but there were no hashes in the orginal code and no date fields at all in the search form.

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #3
"Abby B via AccessMonster.com" <fo***@AccessMonster.com> wrote:
Thanks for your reply but there were no hashes in the orginal code and
no date fields at all in the search form.


This may be the cause of the problem - the hashes may be being interpreted
as date/time delimiters, hence the date/time Enter Parameter prompt. Are
the hashes part of the field names? Try removing them/using a more
acceptable nomenclature.

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #4
Oh u mean the hashes in the field names! no that the field names and they didn't do any problem before. It wasn't causing the popup and the code I added doesn't have them which caused the pop up so I don't know why I get it?

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #5
"Abby B via AccessMonster.com" <fo***@AccessMonster.com> wrote:
Oh u mean the hashes in the field names! no that the field names and
they didn't do any problem before. It wasn't causing the popup and the
code I added doesn't have them which caused the pop up so I don't know
why I get it?


In that case, in your modified code, try changing

stLinkCriteria = "[customer]=" & Me![txtcustname]

to

stLinkCriteria = "[customer]='" & Me![txtcustname] & "'"

(assuming that txtcustname is a text data type).
Nov 13 '05 #6
I still get the pop up! any other suggestion.

Thanks for your help!

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #7
"Abby B via AccessMonster.com" <fo***@AccessMonster.com> wrote:
I still get the pop up! any other suggestion.


I just re-read your OP and note that the data types are numeric, so the
quotation marks are not necessary.

I'm at a loss as to why adding the code you say you added causes the
problem - a date input prompt makes me suspect the hashes - are you sure
nothing else has been changed, including any underlying stored queries (has
any criteria been added for example)?
Nov 13 '05 #8
The original code had a wrong field and the criteria in the customer field was not working so I had to redo it and it works but the you get the pop up...Actually, the other fields are not numberic they are numbers but includes letters so it is text type...

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #9

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

Similar topics

2
by: Pamela Chatterjee | last post by:
In my Web Form I have more than one Textbox for user input. If I hit enter to any Textbox its submitting the form. How can I prevent Form submission if users hit enter to the textbox? I want to...
4
by: Simon Wigzell | last post by:
Is there a way to prevent a form submitting when you press enter on a text field? Some people press enter when they finish typing in a text field out of habit I guess unconcsciously thinking it...
6
by: Squeamz | last post by:
Hello, Say I create a class ("Child") that inherits from another class ("Parent"). Parent's destructor is not virtual. Is there a way I can prevent Parent's destructor from being called when a...
9
by: Catherine Jo Morgan | last post by:
Can I set it up so that a certain combination of fields can't contain the same entries, on another record? e.g. a combination of FirstName/LastName/address? Or FirstName/LastName/phone? Or...
1
by: Chuck | last post by:
I have a query that uses the query with the critera set to . We I run the query the msgbox pops up asking for the name information to be entered, but on the top (blue background) of the message box...
9
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have...
3
by: Randy | last post by:
I want to set up a table where I can enter dates that will prevent data entry of Dates in the Main table. I have done this in Approach by linking two tables and setting up a validation formula...
14
by: Ed Jay | last post by:
On a multi-textbox form, linked to an external js, I use onBlur to call: function chkNum(cellname) { var str = document.getElementById(cellname).value.toString(10); if (str < 28 || str > 36)...
2
by: billtubbs | last post by:
Hi I am getting the common problem of the "Enter Parameter Value" dialog box, which pops up every time I execute a query. I built the query using the Expression Builder in Access. If any of my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.