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

Access 2013 User Defined Function call from on click not working same as 2007

I have a button on a form. in the on click I am calling a user defined function. If there are no letters it appears like this:
=showsystemdetails(12345)

if there are letters it autodefaults to this:
=showSystemDetails([D05013368])

Here is my code.

Public Function showSystemDetails(ID)
On Error GoTo showSystemDetailsErr

Dim stDocName As String
Dim stLinkCriteria As String
Dim stSysNum As String

stSysNum = "ID"
stDocName = "frmLookup"
stLinkCriteria = "[system #]=" & "'" & stSysNum & "'"
DoCmd.openForm stDocName, , , stLinkCriteria

Exit Function

showSystemDetailsErr:
MsgBox Err.Description

End Function



For some reason it doesn't like the letter and errors out. this DB was originally written when there were not letters in the system # field. There now are and I do not know how to work around this so that the frmLookup opens with the proper data present. Please help. Thank you very much in advance. Also, I am working with Access 2013 now, originally used 2007.
Oct 6 '16 #1
1 987
Hello again, perhaps I did not put enough detail. In the on click property I'm typing =showsystemdetails(1234) Showsystemdetails is the user defined function. the (1234) is the computer ID. This works perfectly when there are only numbers in the computer ID. It walks through the user defined function, opens the form named frmLookup with the details for computer 1234. If the computer ID includes a Letter, such as (D013456)....which is how all of our computers are now ID'd. Brackets are automatically placed around the computer ID [(D013456)] and the code runs but the frmLookup opens blank. I need frmLookup to open populated with computer ID data for what is in the parenthesis. Please help, and I'm grateful in advance for your assistance.
Oct 10 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike Chirico | last post by:
With mysql-4.1.1-alpha, using any User Defined Function ( UDF) at the query execution stage, on Linux 2.6, gave me the following error: "ERROR 2013 (HY000): Lost connection to MySQL server...
2
by: Steve D | last post by:
I've looked all over but can't find a solid answer. I've got a function that runs from a View and when the function runs the first time it is calculating a Temperature for a group of Formulas. ...
13
by: Maroon | last post by:
Hi, I want to write a standard java user defined function, like this example:- select db_fun("roll"), roll from student; **db_fun() will work for all tables of the all databse here db_fun is...
1
by: CapeCoder | last post by:
I'd like to use the Excel.WorksheetFunction library to compute median and percentiles in a user-defined function. I'd like to use the data from the calling report as the function argument. ...
1
by: David Carwile | last post by:
I want to add a user defined function inside of an SQL string. I am using the function to change a group of numbers in a string to a specific format that can be sorted by Access(utilizing 0s). ...
1
by: Mphoza | last post by:
Hi! Programmers,,,,,, Scenario I have a DataGrid with the delete button, If the user delete the row I'd like to show a confirmation dialog box with two buttons(Yes,No). If the user click yes...
6
by: JLupear | last post by:
I have written a code (a translation of my first one) that is not working. I did a user defined function that is used on 'onsubmit'. It should total the value from the form selections and...
0
by: mohitgyl | last post by:
Hello, I am trying to call a stored procedure in a user defined function. CREATE FUNCTION test () RETURNS DECIMAL (15,4) LANGUAGE SQL READ SQL DATA EXTERNAL ACTION
1
by: buyoy | last post by:
I am creating a database for the purpose of calculating the length of time that had passed between two milestones. -------------------------------------------------------- 1 ...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.