Modules & VBA :: Turn On / Off The Light Attached To Usb Port Through It?

Jun 2, 2015

Is it possible enable and disable a usb port via vba?

An example of using this would be if I had a light plugged in a usb port and the code would turn it on and off.

Or maybe is there s some device like <PC-Some Device-USB light > which can be controled by vba

View Replies


ADVERTISEMENT

Read Comm Port (Serial Port)

Apr 9, 2007

I have soem code that is looking at the Comm port on my laptop....I had this code working great about 9 months ago. I dont know what has changed besides me moving to another laptop.

I dont know if I am missing a reference to a llibrary or what. I think I am....

Right now I am bombing out on the First Line....

DOES ANYONE HAVE ANY IDEAS HERE....


ERROR:
Run time error 424
Object Required

CODE:

MSComm7.InBufferCount = 0 'Flush the Buffer

If (Not MSComm7.PortOpen) Then

Dim Instring As String ' Buffer to hold input string
MSComm7.CommPort = 1 ' Use COM1.
MSComm7.Settings = "9600,N,8,1" ' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm7.InputLen = 0 ' Tell the control to read entire buffer when Input is used.
MSComm7.PortOpen = True ' Open the port.
MSComm7.Output = "AT" & vbCr ' Send the attention command to the modem. Ensure that the modem responds with "OK".
Buffer$ = Buffer$ & MSComm7.Input ' Wait for data to come back to the serial port.
'MsgBox "SMS Port Open", vbOKOnly, "Port State"
Else
'MsgBox "SMS Port Already Open, It is now closing, and will re-open", vbOKOnly, "Port State"
MSComm7.PortOpen = False
'MSComm7.PortOpen = True
Call Command8_Click
End If

View 4 Replies View Related

Modules & VBA :: Send Command To Device Connected Via RS-232 Serial Port

Feb 10, 2014

Using Access 2010

How do I send the command "^G" to a device connected via serial port (RS-232) number 3?

View 1 Replies View Related

Modules & VBA :: Send Commands To External Device Using A Serial Port

Dec 10, 2013

I need to send commands to an external device using a serial port.My understanding is that that I need to select the reference to the Microsoft Communications Control (MScomm32.ocx).But is not available in the list of references!

View 2 Replies View Related

Modules & VBA :: How To Turn Off Bluetooth And WiFi

Feb 22, 2015

How can I turn off wifi and bluetooth using vba

View 1 Replies View Related

Modules & VBA :: Rename PDF Attached To Email

Dec 13, 2013

I'm using 2013. The first version of my code works great. It opens the correct report and attaches it to an e-mail as a pdf with all of my text etc.

Code:

Private Sub btnEMail_Click()
On Error GoTo errHandler
Dim strReport As String
Dim vMsg As String
Dim vSubject As String
Dim strWhere As String
strReport = "RptJobDSD"

[Code] ....

The problem I have is I would like to rename the pdf, so instead of "RptJobDSD" everytime, it can have some fields [DSDDate] and [JobID] etc.

Before trying the fancy field stuff I thought I'd try just "DSD Test" and see if I could rename it in the first place!

I added this and am getting - Error(32004) - The control name 'RptJobDSD' is misspelled or refers to a control that doesn't exist.

Code:

DoCmd.OpenReport strReport, acViewPreview, , strWhere
DoCmd.SetProperty strReport, acPropertyCaption, "DSD Test"
DoCmd.SendObject acSendReport, strReport, acFormatPDF, , , , vSubject, vMsg, True

My confusion comes as the OpenReport and SendObject recognise strReport why doesn't SetProperty?!

View 2 Replies View Related

Modules & VBA :: Turn Off Graph Double-click

Jun 5, 2013

Whenever I double-click a graph in a form that is being viewed it opens up MS Graph in edit form. This is confusing/ugly/etc and I don't want it to do that.

I tried adding some code to the double click event to make it do some other action (bringing up some graph modification tools I created), but as soon as those are closed MS Graph will then open up in edit form.

How to turn this off? It's incredibly unprofessional.

View 5 Replies View Related

Modules & VBA :: Changes Color Of Button From Light Blue To A Darker Blue

Nov 30, 2013

Private Sub TestButton_Click()
Dim bc As Long
bc = TestButton.BackColor
TestButton.BackColor = bc
End Sub

Somehow this changes the color of the button from light blue to a darker blue. Yes, this has no real purpose, but it is a test to see why be app. isn't working. I store the color, but it back and it's not the same color.

View 6 Replies View Related

Modules & VBA :: Open Cash Drawers Attached To Receipt Printer EPSON T-20

Mar 24, 2014

We have an Access database that opened some cash drawers attached to the computer through USB and it is working perfectly. We have some of the cash drawers that are attached to the EPSON Receipt printer and we also want to open those Cash Drawers attached to the receipt printer. Looking for code to open the cash drawer attached to the receipt printer, Is there any command available that I could send to the receipt printer and it would open the Cash Drawer.

I have also taken the screenshot of the utility program that will show the information regarding the printer and I am very expecting to get this working soon as we have build the Microsoft Access database that would checking the cash drawer status and also open the USB cash drawers.

View 6 Replies View Related

Port Database

Mar 3, 2005

Hello,

I have a lotus datbase at work and there are far to many conflicts with XP. I am trying to make an access database but keep getting as far as the calculations and then give up.

I have a ships data base. I am trying to calculate totals for each vessels cargo.
Some vessels have more than one cargo. eg A Shell Oils vessel may have Diesel, Unleaded or Leaded Fuel on the one trip.

I have been able to get these totals to work b4 but I forget how I did it. If I calculate Cargo1+Cargo2 + Cargo 3 I get 100200300

The other problem that I have is that the totals do not appear in the corresponding table and so I am not able to use totals in query or report.

eg Form Cargo Cargo Tonnage 100
Cargo 1 Cargo Tonnage 1 200
Cargo 2 Cargo Tonnage 2 300
Cargo Total 100200300 :mad:
Am I going about this form in the correct way or am I totally going against the grain of access?

Any help would be appreciated.

Thanks

Mr Wheeze

View 4 Replies View Related

Forms :: Option Button Traffic Light System

Aug 1, 2013

I have set up a group of 3 buttons to select between on my form which works fine.

However I want this to be a bit more visual than it is so Id like to introduce a traffic light system which lights up RED ORANGE or GREEN depending on which one has been checked.

I am not too sure how I would go about achieving this, im not sure if you can import images and hide them or show them depending on the selection or if it requires something further.

View 4 Replies View Related

Reports :: Convert To PDF - Column Headers Light Blue Or Grayscale

Jun 11, 2014

I have two separate reports. They have identical formatting. When I click on Adobe: Convert to PDF, this is what happens. Report 1 will convert with light blue in the column headers. Report 2 will convert with grey scale in the column headers. I have no clue as to how to make them both light blue or both grey scale. My boss wants them to match.

View 9 Replies View Related

Accessing NMEA Strign From Com Port

Aug 11, 2005

I have a few questions which I hope you all can help point me in the right direction.

A little background is in order. What I am trying to accomplish is Read the NMEA string passed to the Com Port 1 of a laptop from a Trimble GPS Unit. Once I have the string I need to parse it ang place the Lat Long in a couple fields in my Access Database. First off I have to capture the string from the Com Port.

Does anyone have any suggestions of where I can start to learn the code needed to read the Com Port 1 to retrieve the NMEA String pushed from the GPS Unit?

How can I do this from within an Access Database?

If I can get the string returned to a variable that would be great. From what I heard other people were writing this to a file?

Any help would be appreciated.

Thanks,

Jay

View 1 Replies View Related

Search Key Not Found In Any Record Error (Trying To Port Database File)

Jul 24, 2015

My database is in database where we do the editing and using Access for query reports.

Upon importing from External Data Link to the data source by creating a linked table: the table was created but running a query yields the above error.

View 1 Replies View Related

Forms :: Create Rectangle Covering Only Desired Controls And Then Make Back Colour Light Gray

Apr 15, 2015

A2010 - on an existing form I have a few controls that I want to hightlight. I thought I would create a rectangle covering only the desired controls and then make the back colour a light grey. But if I do then I cannot see the controls. If I change the back style to transparent then the colour reverts to nothing and I'm back to square one.

It feels like I want to bring the existing controls to the font - but how?If I create new controls on an existing grey rectangle then it works fine.

View 10 Replies View Related

Can I Turn Off The Toolbars?

Jan 13, 2006

i am wanting to find some way of turning off the menus and toolbars in a startup macro and is it possible to turn off the warning messages that appear when appending or deleting rows in a table. many thanks

View 3 Replies View Related

Turn Off Db Remotely

Dec 11, 2007

I have a multi-user db. There are actually 3 computers all on a windows network that access the db, which is located on my hard drive. The computers are in different offices.
I've asked the users to please close the db when they are leaving for the day - so that it does not remain open - and lock me out of design mode. But they sometimes forget and leave the db open.
When I come in in the morning (I'm the first one here) I sometimes have to walk to their offices and close the db manually.
Is there any way to close the app from my computer - so that all instances of the db are closed? Perhaps even a button somewhere with vba code that would do it?

View 11 Replies View Related

#Error - How Do I Turn Into A Zero?

May 31, 2007

Hi, I have a query with a 'many to one' join from a table of selected part numbers I want to look at which includes new part numbers with no current order numbers, to a master order table with all order numbers raised against all part numbers. The query returns null values for the new part numbers with no orders. This is what I want to see and the order numbers are stored as text.

I have converted these to numbers using CLng as I need use them in caluculations that only require adding or subtracting - (no DIV#0 issues). However, the nulls are returning '#Error' in the calculated fields which creates a type mismatch issue when filtering or setting other criteria. All fields used in the calculations are numeric.

I do not really have any knowledge of SQL, but is there a way to make the '#Error' values show as zero or something else I could work with.

Any help appreciated.


Thanks

View 7 Replies View Related

Turn On DAO 3.06 Reference

Nov 24, 2004

I am using Office 2003. I tried entering this line of VB code :
Dim Db As Database
but got the following error :
Compile error : User defined type not defined

checked the net, which said to open the module window, go to Tools>References and check the DAO 3.06 box... but it said in Office 2003 i dont need to do this...Anyway i tried looking at the references but DAO 3.06 is not even there... pls tell me what to do

View 2 Replies View Related

Turn Off Screen Updating

Jun 15, 2005

I've had a search and can't find anything along these lines...

I've got some code which plays about with reports and it looks awful when it's running - is there an equivalent of Excel's "Application.ScreenUpdating = False" functionality in Access (2000)?

Dave

View 2 Replies View Related

Turn Of Warnings On DB Startup - Is This Possible?

Jun 27, 2006

Hi Guys,

I'm not sure this would be allowed as it could be maliciously abused, but what I want to do is turn of warnings when a user fires up my DB.

What currently happens is a user gets 3 pop up warnings in a row the first time they use the DB with essentially the same warnings and "do you want to run this" questions.

The next time the user runs the DB they only get one warning.

On another thread I was told how to turn warnings on and off within the database:
http://www.access-programmers.co.uk/forums/showthread.php?p=499732#post499732

'Turn warnings on & Hourglass on
DoCmd.SetWarnings False
DoCmd.Hourglass True

Code in routine that would generate warnings goes here.

'Turn warnings on & Hourglass off
DoCmd.SetWarnings True
DoCmd.Hourglass False

What I would like is some way to replicate the functionality for the DB. Is this possible?

Thanks in advance,

Keith.

View 14 Replies View Related

How To Turn The Report Zoom To 100%?

Jul 15, 2007

How can I make the default zoom of the Report to 100%. Is there any way?

Thanks,

View 2 Replies View Related

Are My Table Relationships Ok? Pic Attached

Jul 23, 2007

My database is to track customer incidents. Can anyone tell me if my relationships look ok? I'm a remedial access user to any input would be appreciated. Thanks in advance for the help.

View 6 Replies View Related

Checking For Attached File

Jan 25, 2005

I would have thought this was easy, but I keep getting an error.
I have a form with a save button. When the save button is clicked, I want it to check if user has attached an OLE object to a bound object frame. If they have, I'd like a checkbox to be true.
Here's the code I tried:
If Attachment.LpOleObject = 0 Then
Attach.Value = False
Else
Attach.Value = True
End If
This seems so incredibly straight forward and it does work if there is an attachment. If there isn't I get the message that my database can't retrieve the value of this property.

Any help would be greatly appreciated.

View 4 Replies View Related

Turn A Form Into A Switchboard

Feb 27, 2006

I have made two main menus, one for admin and one for users, I want to turn these into switchboards. When you open a form asking you to log in opens if you supply the right password it opens another form depending on your access rights depends which menu it opens, it all works perfectly but I want a home button, i.e. close all open forms, which would close the main menu, so I need to turn the main menus into switchboards, I have tried searching this place and I have also tried google although I may aswell have stuck my head out an open window and shouted for help!

Any way any help much appreciated
Regards

View 4 Replies View Related

View Attached Image

Sep 21, 2006

Okay, my boss gave me this killer project and I just have a brief question to see if anyone thinks I can do this.

Right now, I have a database for business card management.

I have 2 tables

1)Contact Info - Has various contact info fields
2)Business Card Table - Have 2 fields, CardID and Card (field is OLE object to attach business card to the database.

I have the CardID field in a relationship with the same field in Contact Info.

I have 2 questions:

1) I am using Access 2000, and would like to know if there is a way to allow the OLE field to be a jpg attachable field. I did not see it as an option, only .bmp Cry

2) Is there a way, that when I pull the information up in a form, it can display the attached business card that is attached to the database?

What can I do?

Thanks for any help in advance.

Shannon Ann

View 1 Replies View Related







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