Thank you for your help. At the end I have used each of your suggestions and have come up with the code that I am sharing.
My idea is to associated the code to a button that exports data to a MS Word template. The controls that will contain data cannot be null therefore the code checks if the...
Thank you both for the help.
While testing Arnelgp's code I have noticed that when trying to enter data in the empty controls, I get an error message (see file) each time I click in a textbox or cbo. (see attached screenshot).
Since I really like the idea of coloring the empty controls I was...
Hello,
I would appreciate your help with VBA code that checks if any of the multiple controls on my form are empty. Controls are combo and textboxes. My form has about 5 combos and 20 textboxes.
If any of these controls have no data, then I would like to add a msg box saying, please complete...
Hello,
I have a form on which I have added an unbound textbox (txtResult) which I would like to return a given value depending if data is entered or not in another textbox (txt3).
Currently, txtResult shows a value between txt1 and txt2 (which is located in a subform.
txtResult has the...
sure, no errors. It was working up until a few days ago although erroneously because in both cases (whichever value I entered in txt1), it exported data to Word.
Exactly.
When I enter "Partial" in box 1, I get the msgbox and the code stops running.
If, on the other hand, I enter "Total" the code does not execute, meaning data is not exported to my Word template. Thank you
Hello. Sorry for not having simplified my post. I will try to explain it better.
I have a form which exports data to Word using bookmarks. Code should execute depending on the value I enter in textbox (txt1).
If the value in txt1 is "Partial", then I only want a msg box and after that the code...
Hello,
I am having a problem with an IF/ELSE statement, although used many other times.
I have a cmd button on a form which executes or ends a certain code, depending on the value in txtbox1. Thank you for your help
If Me.txt1 = "partial" Then
MsgBox "Sorry, you cannot perform this action is...
Hi,
Both the template and new file will be in the same folder but here is the problem. I do not know how to write the StrSavePath. Do you mind helping me with it? Thanks
Hello. I am sorry for the confusion.
I will try to be more clear.
I export data from a form to a Word Template named Memo.dot.
The template is stored in P:\Test\Memo.dot
Its' path and name is indicated in a table named TablePath which has two fields:
1) Template ID, indicating the name of...
Yes, I will use the FileNo to concatenate.
I have tried your code but getting an error (cannot find the file) in the .Attachments.Add strFileName,olByValue, 1 line.
For your convenience, I am posting the entire code. Thank you
Dim objWord As Object
Dim strPath As String
Dim strBody As...
Hello,
I have a form which exports data to a Word file and saves it with the value indicated in the textbox (FILENO).
I then have a code that opens Outlook but I am having problem in attaching the correct file.
The code (wrong) that I have come up with, will only attached a file with a...
Hello,
I have f form used to export data to a MS Word template which is then attached to a new Outlookl session.
Since the recipient email address can change, I would like to choose the email address directly from a combo available on my form , which lists all the recipients.
The part of the...