473,729 Members | 2,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to run a function (which pings the IP_Address field value) on a continuous report

5 New Member
Hi, I already search on the web but as I'm a beginner in VBA I didn't find the specific answer to my question. In fact I have a DB with Printer and I would like to display a list of them in a continuous form (form not a report sorry for the title) and have a ping status on each row. I already have a function wich ping the IP_Address value and return a True or False. This obviously works well on a form with just one printer and then one IP_Address value, but not in the continuous form where I have a list of IP Addresses. How can I run this function on each IP Address value in the continuous form (in the purpose to get the True/False value if it ping and modify an unbound field to indicate if the printer ping)? I hope it is clear. Thank you very much in advance.
Jun 26 '13 #1
10 1602
zmbd
5,501 Recognized Expert Moderator Expert
Fixed your title per your post.

Your function should refer to the control on your form that has the IP address (say it's named "txt_ctrl_print erip") and be entered into the control source of {unbound control} (say it's named "txt_ctrl_pings tate") so that the entry is something along the lines of =fnc_printer_pi ng([txt_ctrl_printe rip])
Jun 26 '13 #2
Seth Schrock
2,965 Recognized Expert Specialist
You would have to call your Ping function in the query that is the recordsource for the form. This would create another field that would give you your true/false result. However, this has the potential to take a long time to then open the form as it is having to ping each IP address. Just something to consider.
Jun 26 '13 #3
RaffaEl13
5 New Member
@Seth Schrock
Hi Schrock, thank you for your reply, I open the form from this:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "PrinterReport", acNormal, , sWhere, acFormEdit
sWhere contain the criteria of the request for exemple
Expand|Select|Wrap|Line Numbers
  1. sWhere = "building =" & Chr(34) & building & Chr(34)
to filter all the printer in a specific building, (choosen with a combobox) anyway, my question is could I use this to call the "ping" function (named PrinterOnline) and how? Sorry I just build my code copying from different source but I begin in VBA and probably I ask question seeking in the false way. Thank you very much for your help!
Jun 26 '13 #4
RaffaEl13
5 New Member
@zmbd
Hi zmbd, thank you for your reply, actually it works well on a form with one record, meaning one IP address, I call the function with this
Dim strPrinter As String
strPrinter = IP_Address.Valu e
If Not PrinterOnline(s trPrinter) Then...

(the function is called PrinterOnline).

On the same form I have some combobox where I can select different criteria as the City or the Building where the printers are and through a button open a continuous form with the list of the printers resulting of the criteria choosen. On this continuous form I will ping each printer.

But even with an easier table, for exemple a list of PCs inside a continuous form, I don't know how call my function as if I do it, I have only the first record line result duplicated on each following lines.

Perhaps Schrock has given the solution but I don't yet understand how to implement it.

Thank you very much for your help!
Jun 26 '13 #5
Rabbit
12,516 Recognized Expert Moderator MVP
You can not use an unbound control. You will need to use a bound control for this. Unbound controls can not have different values for different rows.
Jun 26 '13 #6
Seth Schrock
2,965 Recognized Expert Specialist
I'm going to assume your function is called PingFunction and that is has one argument that needs passed to it; the IP address. In that case, I will also assume that your query has a field named IP_Address. With all of these names, here is a sample of what the query would need to be.
Expand|Select|Wrap|Line Numbers
  1. SELECT PingFunction(IP_Address) AS PingResult, ...
  2. FROM ...
  3. WHERE ...
This will make the query have a field called "PingResult " that will have the True/False result from your ping function for that record.
Jun 26 '13 #7
zmbd
5,501 Recognized Expert Moderator Expert
Rabbit You Confuzzzed me...
Take a simple data calc.
I have two bound fields, call them, "ctrl_tbldate_s tart" and "ctrl_tbldate_e nd"
I want the time elapsed between these dates, so I have an unbound control, "ctrl_ub_calcda ys" wherein the control source I have =DateDiff("h",[ctrl_tbldate_St art],[ctrl_tbldate_en d])
Default view is set for continous forms... this works here in that the elapsed time between the date/time is calculted for each record shown.

So following behind that train... this should still work as I've suggested in #2, indeed, I have several forms that do just this very thing where the function sits in an unbound control and I feed information from the bound field to the function. (I should clear that up a tad in #2 too).
Jun 26 '13 #8
Rabbit
12,516 Recognized Expert Moderator MVP
Sorry @zmdb, you're right. I probably just used the wrong terminology. I was referring more specifically to my assumption from what the OP said. That assumption being that they are populating the value of the control through code rather than through the control source.
Jun 26 '13 #9
RaffaEl13
5 New Member
@zmbd
Thank you very much zmbd! It works fine. So simple (always simple when we know how)that I didn't think it could be done like that. Sorry for the time I did to answered, I only could tested it now. Best Regards!
Jun 27 '13 #10

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

Similar topics

1
2192
by: Randy | last post by:
I built and employment report from the employment table. I then had to add a field to the table. I now need to add that field to the report. I can't seem to be able to do that by clicking on table icon and adding the field as it is not listed. How am I able to add the new field to the report?
13
13190
by: MLH | last post by:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If LaborCost > 0 Then Me!LaborCost.Visible = True If MatlsCost > 0 Then Me!MatlsCost.Visible = True If OtherCost > 0 Then Me!OtherCost.Visible = True End Sub I use procedures similar to the above sub in forms to make controls on the form visible when desired. I'm unable to accomplish this in a report's OnFormat property code. How can I do this on a report?
11
4435
by: pmarisole | last post by:
I am trying to use the vbscript "split" function on a multi-select field. I am trying to do a mass update of several records at a time. I am getting an error and I'm not sure what to do. Here is the code if someone could help... strID = split(request.form("proj"), ", ") projstat = split(request.form("rojstat"),",") impr = split(request.form("impr"),",") idate =...
5
13290
by: Stuart | last post by:
Hi all, Iv'e got a page that has a mass amount of input fields, all of which require a decimal figure. To make it easier when it comes to inputting data, I'm trying to setup + and - links that will increment/decrement the form field value by 1 when clicked. I'm using the following code, however when I click on one of the links, I get the following error -
9
5735
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo field is printed within the detailed area. The problem is, the apllication is not setup properly, thus the users are entering data within the memo field as: location1 1/1/2005 1/1/2006
2
7872
by: jmoore1999 | last post by:
I need to write a t-sql query that will take the value of the previous record into consideration before calculating the current row's new column value... Here's the situation... I have a query which return the following table structure... Full_Name Points ----------------- ------------
2
9673
by: Coll | last post by:
I have a field that I would like to display on a report only if the value of another field matches a certain criteria. If it does match I need the label & the field value to display (though I'm sure I can create a text box joining the label & the field). If it does not match, then I need the label/field (or text box) to be hidden. Any suggestions? Also, there are multiple values (maybe 5) that would meet the criteria (they are being...
9
4288
by: DAHMB | last post by:
I have a Report in which I have one of the fields set up to launch a form with the On Click event. I would like to have the form launch and auto fill a field with the value of the field clicked in the report. For example in the report I click the name John Jones in the Name field, the form launches and I want the name John Jones entered in the Name field of the report. Any ideas So far I have this in the on click event of the field in the...
2
5455
by: buterfly0707 | last post by:
To Get sum of field in crystal report hi i have some problem while getting the sum of the field. i want to get the sum of one filed fro example Debit. but i want to get this sum according to another field called period. means for that period value i want the sum of the debit field in crystel report. and im using dataset. here i know how to get the sum of the debit fild by adding the Fomular field. but i dont know how to take it according to...
3
27915
by: Daryl Austin | last post by:
I have created a mileage report in access. I created a calculated field called "mileage value" that takes field Mileage x field IRSRate. Each is for a given date field in a table. This works fine in the report. What I would like to do in the report is now Sum all of the mileage values (shown by date)for a grand total at the end of the report. I can't seem to figure out how to do that since the Mileage Value field is really just a...
0
8921
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9427
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9202
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8151
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4528
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.