How To Call A Written Function That Are In DLL File In A Form?

Jan 16, 2007

With the script in the form that is part of MS-Access. I wonder how do I access/call the written function that are in the DLL file I made. I appreciate your help on this one...

View Replies


ADVERTISEMENT

Modules & VBA :: Static Shell Function Call Works But Dynamic Call Fails

Sep 4, 2013

I'm having to recode some old MS Access DBs so they will run in the following environments:

Office 2000 on WinXP
Office 2003 on WinXP
Office 2010 on WinXP
Office 2000 on Win7
Office 2003 on Win7
Office 2010 on Win7

When I wrote my code for Office 2000 on WinXP things were simple because directory paths were the same across all computers and I could hard code pathing when using a shell command to launch other files.

My new approach is to make a function call to the Windows registry to determine the default executable and path for opening a file based upon its extension (see apicFindExecutable in basWindows API module).

I'm able to use code to create a shell call and debug print it to the immediate window. If I put my cursor in the immediate window at the end of the shell call and hit [enter] the external file will open as desired. If I try to open the external file directly through code, I get a file not found error.

To recreate the error take the following steps:

(1) browse to files that are accessible from your computer
(2) click the PREPARE DATA AND OPEN MAIL MERGE DOCUMENTS command button

Shell function call is made by the fnOpenFile function located in the basOpenFile module. There has to be a trick here that I'm missing.

View 5 Replies View Related

Call A Function From A Field On A Form

Aug 8, 2006

Is it possible to call a function from a field on a form, ie, in the
control source put = FunctionName(abc)? Then I want to concantenate
it to another variable so it would look like:

=FunctionName(abc) & TextVariable

I tried this and got the ?Name on the form, like it couldn't find the field
name, which is really a function I'm calling.

Is this possible and if so, what am I doing wrong?

Thanks in advance for any help.

View 1 Replies View Related

How Do I Call This Function?

May 3, 2007

I did some searching and found this function posted by someone in response to the exact same problem I'm now encountering.

But how do I call this in my query?

Function StripZeros(pstr As String) As String
Dim n As Integer

n = 1
Do While Mid(pstr, n, 1) = "0"
n = n + 1
Loop
n = IIf(n > 1, n, 1)
StripZeros = Mid(pstr, n)

End Function

View 2 Replies View Related

Function Call From Qry - What If Null???

Dec 1, 2005

Hi all!

I have a query that returns some fields with "#Error" ...

The reason is that I call a function in the query, and the function chokes if there are no matches in my query criteria and therefore no argument is sent to the function.

I tried putting this in the function:
var = Iif(IsNull(var) = True, 0, var)
-but I still get "#Error" when there are no matching records.

I presume this is because not even Null is given to the function as an arg.
Should I make the arg optional or how can I solve this??

Thanks :)

View 6 Replies View Related

Call A Function In Excel

Oct 29, 2004

I have linked an excel workbook as different tables in Access.
The workbook contains a Microsoft Query. I have now found out how I can open and edit the workbook from access, how can I Update/refresh the MSQuery before I close it?

Here is what I have:
Private Sub cmdTest1_Click()
Dim MyXL As Object
Set MyXL = CreateObject("Excel.Application")
Set MyXLSheet = GetObject("c: est.xls")
MyXL.Application.Visible = True
MyXLSheet.Parent.Windows(1).Visible = True
MyXL.Application.Cells(1, 1).Value = Now()
MyXLSheet.Close SaveChanges:=True
MyXL.Application.Quit
Set MyXL = Nothing

End Sub

eroness

View 1 Replies View Related

Using A List Box To Call VBA Function Or Macro

Feb 23, 2007

http://www.access-programmers.co.uk/forums/showthread.php?t=123538

Following on from that thread, I would really like to tidy up other areas of my front end. I am using the idea that Roy suggested and it works very well.

At the moment, I have a form, that has buttons on it that people click when they want to generate specific sheets from excel using data from access using VBA on the form. These work fine, however, now that the database is going live and all features need to be added, I think it would be nice to have one small form, with a list box.

I have converted a copy of the code on the form and placed in a module by declaring then functions instead of private subs.

At this stage, I tried doing it with macros running the code by using a series of runcode. I then created a table that has the macro name stored in it along with a decriptive bit of text detailing the excel chart that gets produced to make it easy for the user.

The list box populates itself correctly, but the problem I am having is I do not know how to make the 'go' button look at the list box, pull the hidden macro/function name from the list, then go and run the macro/function.

I have tried looking about, but have not found anyhthing.

View 4 Replies View Related

Criteria Is Passed By Function Call

Aug 10, 2007

Dear Access Query Expert

I have created a query which has a function call as the criteria for one of the numerical fields. The function returns a string expression such as .....

1) 132 OR 142 OR 156
2) 132 OR 142
3) 132

..... into the criteria section of the numerical field.

Unfortunately, the query doesn't work if the criteria is generated by the function call. However, if I hardcode the criteria (don't send a function call but directly write 132 OR 142 OR 156) the query works.

I am puzzled and I am not sure how to solve this problem.

Thank you so much.

View 1 Replies View Related

Forms :: How To Call A Function From A Variable

Apr 5, 2014

I have the following in Form and it works OK

Call RunForm("frmProviderLookup", "", "Edit", "", "", "Normal", "Normal")

I want to build a combo box with several different RunForm variations as follows:

RunForm("frmProviderLookup", "", "Edit", "", "", "Normal", "Normal")
RunForm("frmCustomerLookup", "", "Edit", "", "", "Normal", "Normal")
RunForm("frmVendorLookup", "", "Edit", "", "", "Normal", "Normal")
etc, there are many of these

When I select one the variations from the combo box the RunForm statement is stored in strAction varaible..How do I code the Call strAction line? (I want only one call statement).In other words how to call a Function from a variable...The start of my module Function works OK and looks like this:

Public Function RunForm(FormName As String, _
Optional WhereCondition As String = "", _
Optional xMode As String = "", _
Optional filterName As String = "", _
Optional Args As String = "", _
Optional WindowMode As String = "", _
Optional View As String = "")

' Parameters (all optional except parameter 1)
' 1 - Form Name
' 2 - Where condition
' 3 - Mode [Add, Edit, View(Read Only), ""(PropertySettings), DS(Datasheet Edit)]
' 4 - Filter Name
' 5 - Opening Arguments
' 6 - Window Mode
' 7 - Form View

View 1 Replies View Related

Queries :: Call A Function Via Control Element In SQL

Jul 18, 2014

is it possible to call a function in a query with the input of a control element?

I have a form, and there is a list box in which I can choose the calculate method. In the query, a field should calculated with the choosen function.

Example:

Code : SELECT tblTest.price, tblTest.Date, forms![formtest]![lstChosenFunction](tblTest.price, 5) As Calc
...

The function has the same name as I can choose in the listbox. But, if I run the query a error appears.

Code : "Function forms![formtest]![lstChosenFunction] could not be found"

how I can call a function in SQL with the input of an listbox.

View 4 Replies View Related

Modules & VBA :: Possible To Call Windows Search Function Into Access?

Nov 3, 2014

I need a search function that will not just open files based on their names but also drill into the documents and search based on what's in it. The only way I can see now is to use the Window's search function (the one at the start button). Is it possible to call that function into access?how do I re-create the search style of the windows search bar for a specific folder? Something like streamreader

View 1 Replies View Related

Modules & VBA :: Call A Preimport Function Whenever Transfer-spreadsheet Is Called?

Oct 16, 2014

I know its not possible. But Just wanted to confirm. Not at all possible?

Code:

Function PreImport(BookToImport As Workbook)
For Each cell In BookToImport.Sheets(1).Rows(1).Cells
cell.Value = Trim(cell.Value)
Next cell
BookToImport.Sheets(1).UsedRange.Rows(1).Replace ".", "_"
End Function

View 1 Replies View Related

Modules & VBA :: Using Shell Function To Dynamically Call Different Pdfs That Are In A Directory?

Aug 13, 2013

I'm looking to use the shell function to dynamically call different pdfs that are in a directory. However I'm getting run time error 5 "Invalid procedure or call argument".

Here is the code (very basic I know)..

Private Sub Liste_Documentation_DblClick(Cancel As Integer)
Dim PathName As String
PathName = Me.Liste_Documentation.Column(2)
' Debug.Print PathName
Shell PathName
End Sub

A typical filepath name is as follows..

S:VenteVendeursMarcCRMDOCSDiligences KYC - LABFT - V 2013 04 23.pdf

View 8 Replies View Related

Excel Cell Value Not Same As Value Written To It

Feb 14, 2008

Has anyone else had this problem?

I have a program that brings in the upper and lower specs to a excel spreadsheet and then brings in the values from lab tests.

The program then uses the specs to determine if the value is in or out of spec and colors the value if it is out of spec.

My problem is that in one cell the upper spec that is brought in is 2.7 and it shows that on the spreadsheet but when you click the cell the true value stored there is something like "2.66990153". Since a test value of 2.7 is greater than that it colors it when it is in fact in spec.

I have stepped through the code and the spec value pulled from the table is coming in correctly at 2.7.

Why would the excel sheet have a different value?

View 6 Replies View Related

Forms :: Controlling When New Record Gets Written

Jun 26, 2013

I have several forms that are set to open on a new record. I'm finding that while I'm working on the design of these forms I'm creating alot of blank records. This makes me think that when users start opening these forms, they may end up creating a lot of blank records as well. I think this is happening because there are controls on these forms that have default values set in them.

Is there a way that I can control how and when an actual new record is created from a form? I was considering using a particular field as a trigger, once it has a value, the record is created. If it is null, then the record is discarded. If I make a certain field a required field in the table, will that prevent a record from being created without an error message?

View 11 Replies View Related

Forms :: Record Is Written Only When Command Button Is Pressed

Sep 17, 2013

I have a form which displays some product details and a stock level. The subform below it allows entry of a quantity to issue and a control button to run a small macro, write a movement record to a stock movement table and then close the form. This works fine.

But the user can also cause the movement record to be written just by keying in a quantity and tabbing out. If this is done several times it writes several movement records and doesn't close the form. I want to ensure that record is only written when the command button is pressed.

Perhaps there is a more conventional or better way of achieving what I want but I can't think of it.

View 2 Replies View Related

Tables :: Possible To Give Written Answers A Number So They Can Be Graphed

Aug 12, 2013

At work I have been tasked with a few Access based problems and one of which is making one of their handwritten feedback forms be input on Access so then responses can be graphed and analysed.

Is it possible to give written answers a number so they can be graphed.

For example.

Question 1 - Give me an example questions?

Answers:

1. Yes
2. No
3. Unsure

So you can see how many have each one when you graph the results. As I have it created with foreign keys at the moment it is displaying the text when I do the queries.

Also... is it possible to make a button so an interactive pdf report can be sent to all the selected user's email addresses?

View 9 Replies View Related

Call Procedure On A Different Form

Aug 30, 2006

Hi,

Is it possible to call a procedure that exists in one form on another form please?

Regards,
B

View 13 Replies View Related

How To Call Form Values In A SQL Query

May 14, 2007

Hi,

I need to build a query where upon form input a different table gets queried.

SELECT *
FROM ((Forms!DCL!PortDropDown))
WHERE ((Forms!DCL!DestinationList=(Reg_Dest.Destination) ));

The "FROM" is my problem. The "WHERE" is working. I am getting a "SYNTAX ERROR IN JOIN OPERATION" error message. Please help.

Thank you:confused:

View 6 Replies View Related

Call Command On A Diferent Form

Feb 22, 2005

What code would i use to say:

on click
goto the form "datalookup" (which is already open)
and run command "cmdupdate_click" (which is a private sub on that form).

do i have to change it to a public sub? or can i just run it? what code would i use?

View 1 Replies View Related

Call A Button Click On Another Form

Feb 6, 2006

Hello everyone!I need to call the button_click procedure for a button on a form (button1), from another form, if you see what I mean!.Basically the user opens form1. They click a button which opens form2. Once they have finished on form2 they press the close button, which is the point where I need to call the button1_click procedure on form1.I imagine it's something like this:Call Forms![frmForm1]![button1]![Click] orCall Forms.[frmForm1].[button1_Click()]But no matter what syntax I try it just won't work! They're very basic forms, with only 2 buttons on and basic commands.Any help appreciated! Thanks

View 5 Replies View Related

Making A Form To Call Up Information From A Table?

Jan 27, 2005

I'm making a customer survey database. Also be aware I'm not proficient with access.

All the customer information is being imported from an excel spreadsheet. That will include ServiceRecordID, ServiceDate, TechID, CustName, ServLocation, PhoneNum, and DeptID.

Another table will include records for answers to 5 questions that will be asked by a manager on the phone. That table is called TblQuestions. This table will also have ServiceRecordID to go with the answers.

What I'm trying to do is create a Form that at the top has a box for ServiceRecordID. I'd like to be able to type in the Number for that ID, and then all the information shows up on the form for that specific ID. And below all that, fields to add the answers to TblQuestions for that specific ServiceRecordID.

The reason I'm doing this is because the manager will get a report with the customer information that needs a follow up call. So I want them to be able to call up that information on the screen with the ServiceRecordID number, and also be able to add in the information that they get back from the customer with the questions that will be asked.

I don't know why I'm having so much trouble with this. But I'm not experienced with access or VBA both.

View 2 Replies View Related

How To Call A Procedure From A Subform In Main Form

May 10, 2006

I have a sub form which has the Save Button. In case the user keys in the details in the sub form, but then directly clicks the Payment command button of the main form, I want to call the Save button in the sub form if the form is dirty, and do the save, otherwise, proceed with the payment command button.

Every time I try to call the save procedure from the main form's Payment button, I get this error that "object does not support this property or method"

I am calling the save button's code in the subform as

forms.MainForm.SubForm.Save Producedure

Exact Code is : Forms.newpatients.InvoiceHeader.Command7_Click

How do I call this command7_click, which resides in the sub form, in the main form, and invoke it only if the data in the sub form has changed.

Please help.

Thanks,
Vinai

View 1 Replies View Related

I Don't Know What To Call My Problem... Adding Another Field In A Form???

Dec 28, 2004

Hi, it's me again. I hope everyone's holiday season is just fantastic!

I need to figure this out and I don't know quite how to explain it. In a form, I have five fields named "Primary Objectives 1" , 2, 3, 4, and 5. Each is numbered consectively. I am trying to figure out how I can add another "Primary Objective" field to the form, if I need it, without adding the field to my parent table. Is this clear? Is it possible??? Thank you!

View 4 Replies View Related

Forms :: Navigation Form - Call VBA Module

Nov 4, 2014

I have three forms - Form1,Form2 and Form3 linked to a navigation form with Navigation buttons. I have separate VBA codes under each Before update event of these forms, Form1,Form2 and Form3 to call a VBA module to track the changes performed by the users(Like an Audit Trail) in specified fields of the forms which will track them to a table.there are control tags in the form properties --> others --> Tag to track the changes in the fields which are defined in the VBA Module.this is the code to call the VBA Module:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.NewRecord Then
Call AuditChanges("UniqueID", "Part No", "NEW")
Else
Call AuditChanges("UniqueID", "Part No", "EDIT")
End If
End Sub

[code]....

The code is working perfect when the forms are run separately.but when they are run from the navigation form by clicking the navigation buttons, the code is not working !!

View 2 Replies View Related

Forms :: Drop Down Box In A Form To Call A Query

Mar 14, 2013

I want to track which user has which phone and track issues with them.

I have all the relationships set up right.

I have tables:

DeviceStatus - for the drop down box, contains IT Stock, Faulty, With User and Retired
DeviceTypes - Contains model numbers for devices
Assets - Contains a link to DeviceTypes, a link to DeviceStatus and the serial number of a phone.

I have a query:

StockStatus - shows Assets.ID, DeviceStatus.Status, DeviceTypes.description and Assets.SerialNumber

What I want as an end result is a form with a drop down box that shows DeviceStatus.Status (which I have working at the moment) with a go button next to it which will call the query that only shows what was selected in that drop down box.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved