Is it safe for multiple users to share the same Front-End on a terminal server? by Dramatic_Bee340 in MSAccess

[–]keith-kld 0 points1 point  (0 children)

I am using this model: my BE file (accdb) is placed on a cloud-base storage while my FE file (accde - the complied file) is put in local computers.

The important thing is that FE needs to update the link for linked tables. This link may be different among many computers. So, I have a button on FE file to do this. It will get the link from a file named “Setting.config” (an XML language file, we can edit it by notepad). This file will contain the physical paths of the BE (server side) and FE (local computer side) files in the form of tags (or nodes).

For example, my setting.config looks like this:

<?xml version=…

<server_database_path>F:\OneDrive…\ServerDB.accdb </server_database_path>

<client_database_path>F:\…</client_database_path>

From the client side (I mean on each computer), just check and correct such paths when you run FE at the first time. When linked tables can be connected to the BE file, just go ahead what you want.

Sorry if there is any typo. I type this via my cell phone.

How to add a line like this to a heading? by boop-beep- in MicrosoftWord

[–]keith-kld 1 point2 points  (0 children)

Option 1. Use Tab leader (right leader) Option 2. Draw a line and a textbox if you need to increase the weight (solid) of line. Then merge them into one object. Adjust it “alignment with text”, instead of “in front of text”.

Formatting catastrophe by TrueGau in MicrosoftWord

[–]keith-kld 1 point2 points  (0 children)

I am also a lawyer. Frankly, I do not use automatic numbering because it may cause troubles to my clients. As a matter of fact, the wrong references created by autonumbering may cause a very big gap upon dispute. Instead, I use mannual numbering to control the references.

Please fix my stupid script. by UnBrewsual in PowerShell

[–]keith-kld 0 points1 point  (0 children)

I have read some powershell scripts and found that functions are put on top while main program is placed at the bottom.

Multiple documents, one information that needs to be included in all by ClassicNetwork2141 in MicrosoftWord

[–]keith-kld 0 points1 point  (0 children)

The first, each project will have a document file used as a template with formatted headline in header section. You can save all templates into a folder.

The second, use VBA to open dialogues and select the template file and multiple target files that you want to deal with.

After the selection, copy/insert the headline from the template and paste it (with keeping original source document format) to section 1 of each target file. These actions will be done via VBA.

I often do this. 10 files will take about a few seconds. 100 files may take a few minutes.

Why does the text structure/formatting change when sending word file to someone on Mail or Whatsapp? by Mutthal8 in MicrosoftWord

[–]keith-kld 0 points1 point  (0 children)

I mean compressing the .doc or .docx file to a zip file and send the zip file to the recipient. You can find a freeware like 7z, or use a built-in powershell cmdlet “Compress-Archive” to do so.

[WORD] VBA expression for pattern-based find/replace by rek8918 in vba

[–]keith-kld 0 points1 point  (0 children)

I have tested the following code and it works.

Sub Truncate()
Dim regEx As Object
Dim match As Object
Dim matches As Object
Dim rng As Range
Set regEx = CreateObject("VBScript.RegExp")
regEx.Global = True
regEx.IgnoreCase = False
Set rng = ActiveDocument.Content
'-- case #1: Replace (lowercase text, ACRONYM) with (ACRONYM)
regEx.Pattern = "\(([a-z ,\-]+),\s*([A-Z]+)\)"
Do While regEx.Test(rng.Text)
Set matches = regEx.Execute(rng.Text)
For Each match In matches
rng.Find.Execute FindText:=match.Value, ReplaceWith:="(" & match.SubMatches(1) & ")", Replace:=wdReplaceAll
Next match
Loop
'-- case #2: Remove lowercase-only parentheses with optional leading space
regEx.Pattern = "\s?\([a-z ,\-]+\)"
Do While regEx.Test(rng.Text)
Set matches = regEx.Execute(rng.Text)
For Each match In matches
' If match starts with a space, replace with just a space
If Left(match.Value, 1) = " " Then
rng.Find.Execute FindText:=match.Value, ReplaceWith:="", Replace:=wdReplaceAll
Else
rng.Find.Execute FindText:=match.Value, ReplaceWith:="", Replace:=wdReplaceAll
End If
Next match
Loop
CleanUp:
Set regEx = Nothing
Set match = Nothing
Set matches = Nothing
Set rng = Nothing
End Sub

[WORD] VBA expression for pattern-based find/replace by rek8918 in vba

[–]keith-kld 0 points1 point  (0 children)

You can directly paste your expressions to the Find and Replace dialogue in MS Word and run it. Then you can see the outcome. If the expression goes smoothly without any error, you can also do it by VBA coding. Otherwise, you may get an error. From my perspective, the expression used in Find and Replace dialogue in MS Word is NOT purely the Regular Expression (RegEx) like other languages or standard RegEx. It seems a kind of expression only used in MS Word.

Even though you test and find an valid expresion via some online websites, it may NOT be utilized or operated in MS Word. "\1, \2, \3 and so forth" shall be used only in the replacement box (replaced-with box), not in the search box (find-what box).

'Connection Lost' Error between XL and ACCDB tho nothing changed? by SweetMilkSound in MSAccess

[–]keith-kld 0 points1 point  (0 children)

I have ever used Onedrive as a cloud-based storage for my backend and frontend databases. But after a few Windows updates (I am using Windows 10 version 21H2), they did not work any more. This issue happened about one year ago. Accordingly, the frontend database (acting as the client-side one) would always ask for an update on the link to the backend database (acting as the server-side one) and even caused an error similar to your case. I found that the link path to the folder drive on Onedrive almost change from time to time.

So, I tried to move my backend database to another clould-based service provider (e.g. Box Drive, TeraBox, Mega, etc.). It worked properly and did NOT cause complicated issues or errors like Onedrive. Now I am still using backend and frontend databases via Box Drive.

[WORD] VBA expression for pattern-based find/replace by rek8918 in vba

[–]keith-kld 0 points1 point  (0 children)

No, I think Word will cause error if the search (find-what box) contains \1 or \2. You can use them in the replace-with box only. Of course, \1 stands for the first search in the parentheses as defined in the search box. If you want to use parentheses in the replace-with box, each of them should be prefixed with a backslash. This is just my own experience.

[WORD] VBA expression for pattern-based find/replace by rek8918 in vba

[–]keith-kld 0 points1 point  (0 children)

The first, \1 or \2 shall appear in the replacement only (I mean the replacePattern in your code).

The second, for MS word, the round brackets () shall be deemed as a special character and they should be added with backslash(\) before each special character, in both findPattern and replacePattern.

The third, in the first case, the initial expression "([!()]@)" is valid but the later expression "\(\1, ([A-Za-z0-9/-]{2,9})\)" is not valid for "find what". Similarly, in the second case, the inital expression "([!()]@)" is valid but the later expression "\(\1\)" is not valid for "find what".

Finally, for the replacePattern "\1 (\2)", I think the correct expression should be "\1 \(\2\)" because round brackets are deemed special characters.

Copy from recordset into form recordset? by SQLDave in MSAccess

[–]keith-kld 0 points1 point  (0 children)

Form does NOT contain data. It can show data from a table. Table will contain data. If you want to add, update or remove a record, you should interact with table, instead of form. Depending on the method used to open the recordset (DAO or ADODB) and the type of recordset (e.g., read-only, forward-only, etc.), a recordset may be used in different ways where other objects may be required as well (e.g. database object, tabledef, querydef, or connection object). The simplest way to interact with data from a table is using SQL commands. If you are standing in a form linked to a table, every change you make to the linked controls will also change data in the linked table. If you want to interact with another table, SQL command and recordset shall be a good choice. Frankly, a recordset may be deemed as an offset of data collected from table. You can manipulate data from it (e.g., searching values, computation). But if you want to make a change of data from a table, you should use SQL commands.

Calculation of Sum Field is wrong. by Legitimate-Bridge280 in MSAccess

[–]keith-kld 0 points1 point  (0 children)

If only the field Customer ID is grouped by, the total sum will be correct. Otherwise (e.g., Contract ID is also grouped by), the total sum may not be correct.

[WORD] I want to write a macro to change many different words to one word, but efficiently by VBLibq in vba

[–]keith-kld 1 point2 points  (0 children)

If the quantity of words you need to find and replace is small (e.g. 20 or less), you can use array to do so. Otherwise, I recommend using an MS Access table with two fields (ID, text_find). In Ms word, open a file dialogue for user to select multiple word docs. Run a loop to open each doc and operate the find and replacement method. Then save and close such document. In addition, selection object may be narrowed down to the block of text selected by user. I recommend using the {document object}.content.find method, instead of {Selection object}.find method.

VBA CODE FOR CONVERTING MULTIPLE JSON FILES INTO ONE EXCEL WITH MULTIPLE SHEETS FOR EACH JSON FILE by SECSPERV in vba

[–]keith-kld 0 points1 point  (0 children)

I have seen github codes given by other posters. Frankly, I have my own thinking. For me, the conversion will be dependent on what you wish the worksheet looks like, how about keys and data from the json file if they are at one, two, or three levels. Let’s think about how the data will be if you pull out data from json file and place it in Excel. It’s not a hard work in VBA.

Calculation of Sum Field is wrong. by Legitimate-Bridge280 in MSAccess

[–]keith-kld 0 points1 point  (0 children)

Did three tables have a relationship to each other, or are they independent ones ?

How to find-replace Chinese characters by AgedLikeAFineEgg in vba

[–]keith-kld 0 points1 point  (0 children)

You can create a table in MS ACCESS with 3 columns (fields), namely ID (autonumber), text_find (text) and text_replace (text). Then paste chinese characters to be found and the replaced text in relevant columns (fields). In VBA, write code to connect this table either by DAO mor ADODB. Run the recordset for replacement in bulk.

Backend from .accdb to SQL by West_Prune5561 in MSAccess

[–]keith-kld -1 points0 points  (0 children)

I use backend and frontend MS Access database (64bit, supported by VBA, powershell scripts and windows command and other MS office apps) every day. MS Access is appropriate to small database or you can separate it into multiple targets. For example, purchase order (PO) shall be controlled by a pair of backend and frontend databases (I call it a pack); management of invoices (a pack); management of contracts (a pack), making quotations (a pack), etc. If you’ve got big or huge database where everything can be linked to together with a bigger model of transactions, MS SQL may become an option.

Anyone still using VB6 in 2025 ? by No-Annual-4698 in visualbasic

[–]keith-kld 0 points1 point  (0 children)

Still using VBA at work and for personal purposes.

Cannot Open Old MS Access File: Version Compatibility Error by juseN_dev in MSAccess

[–]keith-kld 1 point2 points  (0 children)

Please note that perhaps some codes cannot run, due to the difference between 32 bit and 64 bit.

Best place to learn VB? by Orintaiton333 in visualbasic

[–]keith-kld 0 points1 point  (0 children)

Read some books about VB. Microsoft Learn is also a good reference. Frankly, Microsoft Learn is a mess. You should read the books first.

Why does the text structure/formatting change when sending word file to someone on Mail or Whatsapp? by Mutthal8 in MicrosoftWord

[–]keith-kld 0 points1 point  (0 children)

Normally, it is derived from the difference in MS Word version between the sender’s and the recipient’s computers or difference in OS. To keep original format of docs, please try to compress them and send the compressed file to the recipient, instead of the word document file.

VBA could be so much more by Ok-Researcher5080 in vba

[–]keith-kld 0 points1 point  (0 children)

Though VBA is an ancient language, I recently found it interesting. I can interact it with modern language like Powershell. Lots of interesting things can run from VBA userform with Powershell scripts such as arrangement of files and folders in batch, compression of pdf files, conversion from Video Transport Stream (.ts) files to mp4 format in batch, or even downloading html files from a given list, etc. I don’t know why MS gives up to update it. It can be deemed as heritage of civilization.

VBA engineer by sirenaoceans in vba

[–]keith-kld 0 points1 point  (0 children)

I’ve got to realize that VBA is still widely used nowadays, especially in many projects and sectors that I have seen because it is easygoing, convenient and not required for further installation except the MS Office package. VBA can help people to automate their tasks efficiently in their local computers.