Jumat, 23 September 2011

Re: [MS_AccessPros] Dlookup error

 

Thank you. That worked great! I always had problems with strings but I like your concise breakdown.

With warm regards,

Arthur Lorenzini| SQL Server/Access Developer l alorenzin@live.com
Office: 605-338-0947| Mobile: 605-857-9137 | Fax: 605-338-0947
 
1316 E. 7th Street
Sioux Falls, SD  57103  
SQL Server Development
Database Adminstration Services
Microsoft Access Development  
Grant Writing TA Services
IT Assessment Services
Software Application Training

From: Duane Hookom <duanehookom@hotmail.com>
To: Access Professionals Yahoo Group <ms_access_professionals@yahoogroups.com>
Sent: Friday, September 23, 2011 10:41 AM
Subject: RE: [MS_AccessPros] Dlookup error
Art,One of the most difficult but important understandings when creating code and expressions in Access (or other languages) is how to work with various data types and their delimiters. Bottom line:text/strings require single or double quotes as delimitersnumbers require no delimitersdates in Access reqire "#" delimitersMe.txtEmployeeName = DLookup("[First Name]", "[tblEmployee]", "[EmployeeID]=" & glngThisEmpID )Duane HookomMS Access MVPTo: MS_Access_Professionals@yahoogroups.comFrom: dbalorenzini@yahoo.comDate: Fri, 23 Sep 2011 08:01:42 -0700Subject: Re: [MS_AccessPros] Dlookup error  Actually I got this to work and you are correct about the quotes:glngThisEmpID = DLookup("[EmployeeID]", "[tblSecurity]", "[UserID]='" & Forms![Login]![txtUser] & "'")So now what I am trying to do is load my employee first name into a text box on my Home screen for a Welcome message.I am trying to do this but I am gettign a data type mismatch:Me.txtEmployeeName =
DLookup("[First Name]", "[tblEmployee]", "[EmployeeID]='" & glngThisEmpID & "'")glngThisEmpID is defined as a integer.any ideas?With warm regards,Arthur Lorenzini| SQL Server/Access Developer l alorenzin@live.comOffice: 605-338-0947| Mobile: 605-857-9137 | Fax: 605-338-09471316 E. 7th Street Sioux Falls, SD  57103  SQL Server DevelopmentDatabase Adminstration ServicesMicrosoft Access Development  Grant Writing TA ServicesIT Assessment ServicesSoftware Application Training From: Liz Ravenwood <liz_ravenwood@beaerospace.com>To: "'MS_Access_Professionals@yahoogroups.com'" <MS_Access_Professionals@yahoogroups.com>Sent: Friday, September 23, 2011 9:56 AMSubject: RE: [MS_AccessPros] Dlookup error  Art,Do you need to delimit it with quote marks?glngThisEmpID = DLookup("[EmployeeID]", "tblSecurity", _"[UserID] = '" & gstrThisUser & "'")Liz RavenwoodDatabase Developer / ProgrammerSuper First Class ProductsB/E AerospaceO:
1.520.239.4808www.beaerospace.com-----Original Message-----From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of ArtSent: Friday, September 23, 2011 7:46 AMTo: MS_Access_Professionals@yahoogroups.comSubject: [MS_AccessPros] Dlookup errorI have the following code:gstrThisUser = Me.txtUserglngThisEmpID = DLookup("[EmployeeID]", "tblSecurity", _"[UserID] = " & gstrThisUser)The issue is this is erroring with the following message:Run-time error 2471The expression yu entered as a query parameter produced this error: 'svogel'I am trying to return the employeeid based on the lookup:UserID is a stringgstrThisUser is a stringWhat am I doing wrong?Thank youArt LorenziniSioux Falls, Sd------------------------------------Yahoo! Groups LinksThis email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use,
[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar