UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Ms Surface Code Issue, Access 2016    
 
   
ecovindaloo
post Jun 7 2019, 12:50 PM
Post#1



Posts: 227
Joined: 1-November 08
From: New York Area, USA


'm working on an Access program running on a Microsoft Surface and I've just come across an issue.

I've attached a snapshot of the form with the issue. There is a checkbox on the form called Use 1 Item. What this process does is move or update this item on another form and subtract the quantity by one on the current form. When the quantity gets to zero it is removed from this form. This code works on my laptop with no issues.

The client was having an issue with this process because the code would allow the quantity to go below zero and not remove the item from the form. I had a web meeting with the client this morning and found out that when they use a mouse with the surface the code works with no issue. The Surface also has touch screen ability. When they are using the touch screen this is when the issue happens.

This is the part of the code dealing with a quantity of zero:
If .Quantity = 0 Then
If Not bNoExpire Then
strSQL = "DELETE * FROM tblProjectItems WHERE PN = '" & .PN & "' AND ProjectInformationID = " & Form_frmProjectInformation.ID & " AND " & _
"LotNumber = '" & .LotNumber & "' AND ExpirationDate = #" & .ExpirationDate & "#;"
Else
strSQL = "DELETE * FROM tblProjectItems WHERE PN = '" & .PN & "' AND ProjectInformationID = " & Form_frmProjectInformation.ID & " AND " & _
"ItemDescription = """ & .ItemDescription & """;"
End If

db.Execute strSQL
End If

All of the other processes in this section of code work.

I don't have my own Surface so I'm not able to work on this issue at the office. Anyone have any idea why this would happen and what I can do to get this process to work?
This post has been edited by ecovindaloo: Jun 7 2019, 12:51 PM
Attached File(s)
Attached File  AccessSnapshot_6_7_19_.JPG ( 122.96K )Number of downloads: 3
Attached File  AccessSnapshot_6_7_19_.JPG ( 122.96K )Number of downloads: 4
 
Go to the top of the page
 
Doug Steele
post Jun 7 2019, 02:24 PM
Post#2


UtterAccess VIP
Posts: 22,162
Joined: 8-January 07
From: St. Catharines, ON (Canada)


There is no logical reason why code would work differently on a Surface than on a different piece of hardware.

Is it possible that the Use 1 Box checkbox isn't actually getting checked?

Could you possibly put debugging statements into the code to see what's actually happening, something like:

CODE
If .Quantity = 0 Then
  MsgBox "Quantity is equal to 0"
  If Not bNoExpire Then
    MsgBox "Not bNoExpire is True"
    strSQL = "DELETE * FROM tblProjectItems WHERE PN = '" & .PN & "' AND ProjectInformationID = " & Form_frmProjectInformation.ID & " AND " & _
      "LotNumber = '" & .LotNumber & "' AND ExpirationDate = #" & .ExpirationDate & "#;"
  Else
    MsgBox "Not bNoExpire is False"
    strSQL = "DELETE * FROM tblProjectItems WHERE PN = '" & .PN & "' AND ProjectInformationID = " & Form_frmProjectInformation.ID & " AND " & _
      "ItemDescription = """ & .ItemDescription & """;"
  End If

  MsgBox "About to run " & strSQL
  db.Execute strSQL
End If

Incidentally, is it possible that somehow .Quantity could be less than 0? Should you perhaps add logic to handle that case?


--------------------
Doug Steele, Microsoft Access MVP (2000-2018)
Personal webpage
Microsoft profile
Co-author: Access Solutions: Tips, Tricks, and Secrets from Microsoft Access MVPs, published by Wiley
Co-author: Effective SQL: 61 Specific Ways to Write Better SQL, published by Addison-Wesley Professional
Technical Editor: Access 2010 Bible, Access 2013 Bible, Access 2016 Bible, all published by Wiley
Technical Editor: SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition, published by Addison-Wesley Professional
Go to the top of the page
 
ecovindaloo
post Jun 7 2019, 02:33 PM
Post#3



Posts: 227
Joined: 1-November 08
From: New York Area, USA


Thanks for the quick response.

The checkbox is being checked and other code is running. In the beginning of the code a message box opens and asks if the user wants to move the item. And after the process is run the quantity goes down by one.

When a new item is added the user must add a quantity. Then code checks to see if the quantity is between 1 and 100.

For some reason there is just an issue with that one section of code.

I've written Access programs for the Surface before, but this is the first time that there is an issue with code. And it seems to because of using the touch screen.
Go to the top of the page
 
ecovindaloo
post Jun 7 2019, 02:37 PM
Post#4



Posts: 227
Joined: 1-November 08
From: New York Area, USA


I could put debugging statements in the code to see what is happening at that part of the code.

I was hoping that there might have been an easy answer for why it's happening on the Surface.
Go to the top of the page
 
GroverParkGeorge
post Jun 7 2019, 05:03 PM
Post#5


UA Admin
Posts: 35,146
Joined: 20-June 02
From: Newcastle, WA


Apparently, then, events triggered by the touch screen behave differently from those triggered by the mouse or keyboard?

One of the very most useful trouble-shooting methods ever invented is the ability to step through code, line by line, to see what is REALLY happening as opposed to what we think should be happening.


--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
ecovindaloo
post Jun 7 2019, 05:26 PM
Post#6



Posts: 227
Joined: 1-November 08
From: New York Area, USA


I'm going to step through the code on Monday. I'll post what I find.
Go to the top of the page
 
ecovindaloo
post Jun 10 2019, 10:51 AM
Post#7



Posts: 227
Joined: 1-November 08
From: New York Area, USA


I dialed into the client and stepped through the code and of course everything was working correctly.

Are there issues with the MS Surface and Access?
Go to the top of the page
 
Doug Steele
post Jun 10 2019, 12:01 PM
Post#8


UtterAccess VIP
Posts: 22,162
Joined: 8-January 07
From: St. Catharines, ON (Canada)


None that I'm aware of.

--------------------
Doug Steele, Microsoft Access MVP (2000-2018)
Personal webpage
Microsoft profile
Co-author: Access Solutions: Tips, Tricks, and Secrets from Microsoft Access MVPs, published by Wiley
Co-author: Effective SQL: 61 Specific Ways to Write Better SQL, published by Addison-Wesley Professional
Technical Editor: Access 2010 Bible, Access 2013 Bible, Access 2016 Bible, all published by Wiley
Technical Editor: SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition, published by Addison-Wesley Professional
Go to the top of the page
 
DanielPineault
post Jun 10 2019, 12:46 PM
Post#9


UtterAccess VIP
Posts: 6,664
Joined: 30-June 11



Not to my knowledge. I have a couple clients that run my database on Surfaces and I've never been told about such issues.

--------------------
Daniel Pineault (2010-2018 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
ecovindaloo
post Jun 10 2019, 02:00 PM
Post#10



Posts: 227
Joined: 1-November 08
From: New York Area, USA


Can you think of anything else I could try?
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th June 2019 - 06:30 AM