I have been running a database that reserves or books loan equipment successfully on a local LAN. We are moving from a LAN to SharePoint linked to a cloud based shared drive. I split the database, uploaded the tables from the BE to SharePoint, then linked the FE to the tables.
90% percent of the forms open from the FE, but now I get runtime error 2427 "You entered an expression that has no value". I'm not sure why this is only happening now considering there were no issues prior to the split and SharePoint connection. Error explained further below...
The main form filters equipment and has buttons to reserve, save and return selections - the runtime error occurs. Overlaying the main form header is a text box with an IIF statement to indicate whether reservations exist. That is currently displaying as #Type!
If I debug the load error, Access takes me to a Private Sub_Form () and hightlights in yellow the entire equipment inventory that has been hard coded in; eg:
Private Sub Form_Load ()
'Check time has been entered if equipment is selected
If Me.EquipmentID = "Laptop Name 1" Or "Laptop Name 2" or "Laptop Name 3"...etc, Then
Me.TimeIn.Visible = True
Me.TimeOut.Visible = True
End If
End Sub
Any guidance how to circumvent this would be appreciated with thanks!
Related
I am mostly new to PowerApps but I am creating a stand-alone app that uses Power Automate to upload records to a SharePoint library. I have that working, and on one of the forms I have search functionality so that the gallery is filtered by the value in a few text boxes.
What I want to do is on the form where they upload new records, I want to look up to see if metadata already exists and eventually populate text boxes with the information from those records. Right now I am using a button with this code in the OnSelect event to just find how many records exist with that project number:
Set(varCount, CountRows(Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )))
I also tried this.
If(CountRows(Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )) > 0, Set(varCount, 1), Set(varCount,2))
I am getting a warning about large datasets only. However, when I try to run it nothing happens. When I look at the monitor details I get this error first:
"The query is not valid.\r\nclientRequestId: 816f2bfb-ab50-4285-b9c9-a7e03548d15f\r\nserviceRequestId: 816f2bfb-ab50-4285-b9c9-a7e03548d15f"
Then this one:
"Error when trying to retrieve data from the network"
The connection works when I am filtering a gallery, but not when I'm trying to use the count. Does anyone have any idea what is happening?
Thanks!
I'm not sure, but I suspect that there's an error in your Filter. The second argument should result in a logical true/false (include the record or not). Yours looks to resolve to a string.
Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )
I think you mean
Filter(ProjectDocuments,'txtProj#'.Text = ProjNum )
Beginner filemake rquestion. I'm setting up a layout to tell me how many photo call and other data related to a particular client. So I have a sub summary which shows the client name, and phone call data the body.
The problem is that when the data spills over to another page, the sub summary with the client name disappears, so you have to keep flipping back a page (or sometimes two pages) to see which client the data relates to.
It seems like this should be simple, but for some reason I can't seem to get it to work. Thanks for any help!
You can put the client name in the header part and hide it conditionally when the first record on the page belongs to a client different from the previous record.
First of all, I already found out how to list default event names of Excel UserForm Controls using Typelib Info referenced as TLBINF32.DLL.
I shared it here.
It is a part of my ongoing project to create codeflow diagrams and possibly VBA code obfuscator early alpha version available on GitHub.
The issue now, is, with trying to list Event Procedures of the UserForm itself:
Unlike listing UserForm Controls using TLI-ClassInfoFromObject(UserForm1.CommandButton1), I found out the hard way that I need to use TLI-TypeLibInfoFromFile("FM20.dll") because if I use ClassInfoFromObject(UserForm1), there is an error.
I also found out that I can use TLI-ClassInfoFromObject(ThisWorkbook.VBProject.VBComponents("UserForm1").Designer).
Using FM20.dll and .Designer methods both get 16 event procedure names.
I can manage/understand up to this far.
Then I manually counted the UserForm's event procedure dropdown list in Excel VBA Editor and found that there are 22 UserForm event procedures.
But after I ran the following code using TLI, the resulting list contains 16 event procedures only, as shown in the first photo.
I am using MSForms class/object from FM20.dll.
The code is as follows: (Needs Reference to TypeLib Information library at C:\Windows\SysWow64\TLBINF32.DLL)
Sub listUFEvents()
Dim t As TLI.TLIApplication
Set t = New TLI.TLIApplication
Dim ti As TLI.TypeLibInfo
Set ti = t.TypeLibInfoFromFile("C:\Windows\SysWOW64\FM20.dll")
Dim cci As TLI.CoClassInfo
Dim mi As TLI.MemberInfo
Dim i As Integer
For Each cci In ti.CoClasses
If cci.Name = "UserForm" Then
For Each mi In cci.DefaultEventInterface.Members
i = i + 1
Debug.Print CStr(i), mi.Name
Next mi
End If
Next cci
End Sub
6 events were not listed including UserForm.Activate and UserForm.QueryClose etc.
My question is, why those 6 event procedures were not listed?
If these event procedures were not picked up from the TypeLib in FM20.dll, where do they come from?
Object Browser also shows only 16 procedures.
Or did I do something wrong in using TLI library?
I admit that I am pretty far from becoming/being an expert.
I am still trying to understand how TypeLib Info works.
How do I get all 22 event procedure names?
I need the event procedure names to differentiate user-defined procedures from the event procedures in a UserForm CodeModule in my project which is about listing the procedure calls in a VBA project.
I can't find anybody asking the same question anywhere either.
Edit:08FEB2021
Added project userform image + zoomed one, to clearly show and better explain the question
In the following zoomed photo,
A->, UserForm controls' default event procedures' names
B->, UserForm default event procedure names
C->, User-defined Sub+Function residing inside UserForm CodeModule
Above image is zoomed for better clarity.
***********************************************************
I want to separate B from C like I did with A.
***********************************************************
So that we can know that default event procedures were NOT called directly.
The image below is presented to get a better idea of why I am needing to list the names of the UserForm event procedures.
Apology
I apologize for being a bit political (if you wanna call a function name politics!).
I truly am sorry to have to involve a bit of politics here.
I am not asking for anything except your awareness. Give me a negative vote if you want, for doing what a man needs to do when his country needs him most.
I just want to do something, however small it may be, as a citizen of Myanmar.
Normally, I am not interested in politics but the current situation calls for me to let the world know that Myanmar is currently under siege by a Military coup which forcibly removed democratically elected government and currently oppressing its citizens' rights.
Please bear with me and I hope you all can understand and empathize with me.
Thanks for your kind understanding.
The TLBINF32.DLL does what it is designed (coded) to do, so there is nothing you can do to make it recognize the five events related to MSForm's multiple "open/close" steps, or the MSForm's own window's Resize events. If you want to use them in your code you can, for example, create string constants for the event names you need, or keep them in a lookup table in a worksheet, or in a text file you will read, or whichever other way that suites your project.
As for listing Excel UserForm Controls, you do not need TLBINF32.DLL at all because it's already built (obviously, since TLBINF32.DLL just taps into this) into the MSForm class. To test this, please create a form, name it, say, "Form1", throw in a few controls and run the following simple subroutine from anywhere within the VBA project:
Sub ExamineControls()
Dim ctl As Control
For Each ctl In Form1.Controls
Debug.Print ctl.Name, ctl.Top, ctl.Visible ' anything else you need?
Next
End Sub
It does not matter whether the Form1 is opened or not.
I hope this is helpful.
Currently running into an error problem: when migrating orders in SAP through VBA, it might be that an order needs reconfirmation. However, this is not always the case.
I've already build in an error loop in the beginning of the code, so I don't get the object errors anymore. However, I'd like the VBA to CHOOSE between 2 outcomes.
I had build the code in (which will cause to go to the next order, if there is an error):
'Press "full delivery (build a if function that if field delivery exists and is >1, press f6)
If Session.findById("wnd[0]/usr/tbl/SAPAPO/SAPLATP4CTR_FINAL/txt/SAPAPO/ATP4CSD-BMNGL[6,0]").Text <> ""
Then Session.findById("wnd[0]/tbar[1]/btn[6]").press
End If
Then, if it is not in that screen, it should just check whether it still is in the original screen:
if Session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/tblSAPMV45ATCTRL_U_ERF_AUFTRAG/ctxtVBAP-WERKS[11,0]").Text <>"" then
'Save order
Session.findById("wnd[0]/tbar[0]/btn[11]").press
End if
Unfortunately, this causes an error if it does not go to the Delivery screen (it just stays in the regular order screen). The thing I want it to do then, is to go through with the code.
Is there some way where I can determine in which screen I'm currently, so that VBA takes an action on that.
You could try the following.
for example:
If Session.findById("wnd[0]").text = "Delivery screen" then
...
end if
You would have to use the real screen name instead of "Delivery screen".
Regards,
ScriptMan
This requires a detailed explanation.
Imagine that I have an Excel spreadsheet with test cases in one worksheet
and I may have expected (validation) messages in another (in addition to expected messages in the first worksheet).
There is also some linking between the values of fields in one to the second worksheets.
See: Welcome, <First Name> <Last Name> as an example.
You can see in the "Expected Results" field in "Test cases" worksheet the value of the field is:
"The user is taken to My Account page and following welcome message is displayed:
"&Messages!$B$1244&", where First name is Dave and Last Name is Brown."
so "&Messages!$B$1244&", denotes field B1244 in worksheet "Messages"
Now the question.
If I am given all test cases like the example below for an ecommerce web site, how can I use Coded UI Testing based on this input? Can I automate Excel, use the steps in test case worksheet and combine that with Coded UI recording of data input and verification.
I believe I would need to do manual coding, partially using recorded input steps and verifications from Coded UI recorder and possibly using manual programming for verification.
I would like to hear if others have done something similar.
I would like to incorporate this into Specflow BDD, by writing feature/user story and these test cases will be scenarios.
Any success, thoughts on using Excel test automation as data driven testing.
Thanks
Rad
Test cases worksheet named "Test cases":
=====================
Test Case Name Test Case Objective
frontstore.01-3 Register a shopper from order
confirmation page with valid inputs
# Step Data Expected Results
------------------------------------------------------------------------------------------------
1 Launch the test storefront http://testserver.com/index Welcome page is loaded.
2 Click Sign In link Sign In page is loaded.
3 Click Register under New Customer Register page is loaded.
4 Enter valid inputs and click Submit "Logon ID = TestUser
Firstname = John
Lastname = Clark
... (other fields) Registration Successful.
The user is taken to My Account page
and following welcome message is displayed:
Welcome, <First Name> <Last Name>, where First name is
David and Last Name is Brown."
Validation Messages worksheet named "Messages":
=====================
#Text used in MyAccountPages
---------------------------------------------------------------------------
MA_WELCOME Welcome, <First Name> <Last Name>
After reading a bit about Coded UI testing:
It can certainly be done, but data/sentences like:
“Launch the test storefront”
“Click Sign In link”
“Registration Successful.
The user is taken to My Account page
and following welcome message is displayed:
Welcome, , where First name is
David and Last Name is Brown."
contain both actions and data so I need to drill down into parts of the sentence to
translate it to actions and binding to parameters.
If I understand well data binding can only be used to bind column values to some parameters.
So I need some way to automatically recognize the meaning of these sentences and use some binding
from parts of it.
So if I have a sentence:
“Launch the test storefront” that would be translated to:
CurrentBrowser.Navigate(Helper.TranslateTargetUrlFrom(“test storefront”))
where “test storefront” might resolve to http://testserver.com/index storefront home
page and I can ignore Data column for URL
or I can capture Launch keyword to mean CurrentBrowser.Navigate(ColumnValue(Data)) and ignore “test storefront” part of the sentence.
“Click Sign In link” could be translated to CurrentBrowser.FindLink(“Sign In”).Click(),
so it this case I will need to know that Sign In is
the text of the link, again I need to extract “Sign In” to mean the text of a link.
I see this as pretty manual style of CodedUI where I could do small recording for some actions and rely on manual extractions of terms from
given sentences.
I would like to know how can I semantically write better test cases to allow automation. I would probably need some kind of free form
test case parser that would recognize the semantic meaning of some words like: click, navigate, launch, enter, click under etc and translate this into
code by re-using existing helper methods and recorded actions and do some manual binding, but not with the whole data value in the column, but
an extracted value.
Any idea of this kind of automation?
I think yould could do this by data binding the input parameters and just reading Excel as a datasource, you are going to need to use CodedUI for that not MTM + Fast Forward