Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

data type for parameter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
richaluft@cs.com - 23 Jan 2008 20:58 GMT
Hi:
Can someone tell me what datatype a query parameter should have to
enable a parameter value of "X" or " " (as in null)?  "Text" datatype
doesn't want to work.
Richard
Wayne-I-M - 23 Jan 2008 21:25 GMT
Hi

I am lost on this. Are you wanting to find a field that either contains an
"X" or the field is null?  You could try something like this. Or are you
wanting to prompt for criteria?

SELECT TableName.FieldName
FROM  TableName.FieldName
WHERE ((( TableName.FieldName) Like "X" Or ( TableName.FieldName) Is Null));

Signature

Wayne
Manchester, England.

> Hi:
> Can someone tell me what datatype a query parameter should have to
> enable a parameter value of "X" or " " (as in null)?  "Text" datatype
> doesn't want to work.
> Richard
richaluft@cs.com - 23 Jan 2008 22:22 GMT
On Jan 23, 4:25 pm, Wayne-I-M <Wayn...@discussions.microsoft.com>
wrote:
> Hi
>
[quoted text clipped - 16 lines]
> > doesn't want to work.
> > Richard

Wayne;
You just made me realize that I'm probably misusing a parameter
query.  I'm trying to open a query, but at the same time enter values
for certain fields in my code.  I'll clearly have to use a different
route for accomplishing this.
Richard
richaluft@cs.com - 23 Jan 2008 22:30 GMT
On Jan 23, 4:25 pm, Wayne-I-M <Wayn...@discussions.microsoft.com>
wrote:
> Hi
>
[quoted text clipped - 16 lines]
> > doesn't want to work.
> > Richard

Wayne;
What I wanted to do was to create code for an update query, where I
was inserting my query values into a table, and, at the same time,
adding additional values for fields present in the table, but not
present in the query.  After your comment,I'm not sure if there is any
way for this to be effected.  Perhaps I have to use coding with addnew
for the whole data line?
Richard
Allen Browne - 24 Jan 2008 01:59 GMT
OpenRecordset with AddNew and Update would work.

Unless you need to loop to assign some values, it might be easier to just
build the Append query statement as a string (concatening values into it),
and Execute. Here's an example showing how to build and execute such a
string:
   http://allenbrowne.com/ser-60.html

If the string is long/complex, you can mock one up in the query window, and
copy'n'paste into your VBA code. This might help:
   Copy SQL statement from query to VBA
at:
   http://allenbrowne.com/ser-71.html

I understand that your original question no longer stands, but in general, a
parameter needs the same data type as the field it will be applied against.
And if you do use a Text parameter, and the parameter refers to a text box
on a form, JET won't handle it correctly when the text box is null:
   Parameter of type Text is evaluated wrongly
at:
   http://allenbrowne.com/bug-13.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> What I wanted to do was to create code for an update query, where I
> was inserting my query values into a table, and, at the same time,
[quoted text clipped - 3 lines]
> for the whole data line?
> Richard
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.