I'm creating a form in Microsoft Word that will be distributed to various people. One section on the form is a table where the user lists all the tests that he/she has taken and some relevant details about those tests. I don't know in advance how many tests a user has taken, although I can assume it is at least 1. I'd like to create a table that the user can add rows to for each test. Some of the columns will have form controls, one has a drop box, one has check boxes, one has a date picker. I'd like to be able to link these forms with Access once the user has completed them.
Is it possible to create a user expandable table that maintains the form controls in each column?
I am on a Linux machine right now so I can't test and debug code for you, but I have made tables in Word before where the size is decided at runtime (in fact, I did it from Excel, but that is off topic). However, I can tell you the general form is:
expression.Add(BeforeRow)
where expression returns a rows object, such as
ActiveDocument.Tables(1).Rows.Add(5)
Please see microsoft documentation of dealing with
tables:
http://msdn.microsoft.com/en-us/library/office/aa212430%28v=office.11%29.aspx
and rows:
http://msdn.microsoft.com/en-us/library/office/aa223081%28v=office.11%29.aspx
Also, from the VB editor in word, go to help and search "table object members," "row object members," etc.
If this hasn't been closed by tomorrow I will write something up. I will admit, in my experience Word VBA is a bit more temperamental than Excel VBA.
Related
I have a large database on Microsoft Excel 2010 on which I want to run SQL queries like the =QUERY formula in Google Sheets.
Basically on Google Sheets, the =QUERY can reference cells which take user input. This allows me to dynamically update the table based on the user input fed into the =QUERY. I've created a Google Sheet exemplifying what I mean here (please change cell G3 only) - the only difference between this and the final product would be that the complete table is in a sheet and the dynamically updated one is in another.
I've created a connection in Data Wizard in Excel but it doesn't seem like I'd be able to take user input running queries from there. Also, I've found similar questions here but neither provided an answer to this question specifically.
I want to do the exact same thing on Excel - being I do not want to use VBA, Filters, etc. I want precisely this. Is there a way to do this?
EDIT: I've tried Advanced Filters but they don't respond dynamically to different user input: you input once, it gives you the result, you go back and change parameters and it doesn't change it again.
You can use POWER QUERY for Excel, Info, Download.
I'm looking in to learning some coding and have a small project in mind to begin with,
To begin if anyone could point me in the direction of some good VB.net resources I would be very appreciative,
On a more specific note, I have a few particular questions:
I have a form with several text boxes, how would I go about using this form to establish a connection to an SQL database whereby the boxes on the form are used for (1, servername\instance. 2, database name. 3, sql login. 4,sql password) triggered by pressing the 'connect' button
I also have a form with a single text box, I would like to be able to query a specific table for records where based on primary key = contents of text box. On the form, I'd like to have other text boxes which link to columns on the table and return the value of the associated record.
As a development of the above, I would like to then have a button that writes any changes to the information back on to the record in SQL.
If anyone is able to offer any advise or insight on how I would begin going about this, that would be great.
I would much rather sources of how to learn to do the above that code if possible.
Do several thing or post actual code where you are stuck. it sounds like you will ask about how to put values on Database also. honestly want to say, if you research little bit what you want you will definitely get it. first google and then ask.
because you are in learning phase try to gather as much as knowledge rather copy paste code.
HINTS:
1) set your web.config with connection to sql
see: MSDN document
https://msdn.microsoft.com/en-us/library/ff400235.aspx
2) Then start coding UI
3) on UI you have different boxes, on each button click you should handle separately
search on:
How to open SQL Connection on button click
How to insert new records into a database
and lastly if you came across error then post your issue here.
Good Luck
I have an already existing report that runs off a particular query. This report runs perfectly. I was having an issue with one of the CLIENTs for the report, where I had to change a small piece of information. This required me to run some VBA code and insert all the info into a temp table. I'd like to run the same exact report, however, instead of using a query, to use the tempInfo table. Is there a way for me to do that? it's okay if I create another report, but the first report is somewhat complicated - so it would save a lot of time if I could just copy and paste at least the GROUP, SORT TOTAL so my data is displayed correctly. ANy suggestions?
Copy the report that you are wanting to use and paste it in the navigation menu to create a copy of it.
To use the "Temp Table" in your report, just go into design view of the newly copied report and change the Record Source to your "Temp Table."
You may also need to change the control source of any textboxes, labels, etc..
I have a small SQL database, I want to make a front end GUI for it. VERY basic kind of stuff that basically just allows the user to input data into the GUI which basically just inserts data into the tables from the SQL database. I have the SQL database loaded into Access. I split the database which i think I was supposed to do?? Not sure If i was wrong let me know.
I think I need to usa Visual basic to make the page? I tried tinkering around but I cant seem to find the right instructions online. I basically am just trying to make an Access front end with a GUI that has a couple text boxes that the user will input data into, which will then save into the data to the back end SQL.
Anyone have any direction then can help point me? or if im am just COMPLETELY wrong in doing this that would also be nice to know lol I just thought Ive seen this done somewhere.
First off, your linked tables in Access that link to SQLServer should have the globe icons like this picture:
This means they're linked to the server rather than imported in as a copy of the data. Be sure the tables have primary keys, too; if they're heap tables (ie, no clustered unique index) then the linked tables will be read-only, because Access doesn't know how to send an update query to SQLServer. You can test this by opening one of the linked tables and trying to change data; your cursor won't do anything if it's a read-only table.
To create a super-basic entry form linked to a table, click Insert>Form, then right-click the little square in the upper-left corner of the form and click Properties like this:
Select the table that you want this form to do edits on in the RecordSource property as shown below. You can click the "..." to make a query rather than a single table for the edits, like if you need to join tables, but this gets more complicated because Access gets particular about what queries are still editable and frequently treats the query as read-only if you don't meet all the requirements (for ex, union queries will be read-only):
After you set the RecordSource, click View>Field List and you'll see the fields from the table like this:
Highlight these fields and drag them to the form like this (the unique key fields like ProductID should usually be made invisible, especially if they're autonumber fields, b/c the database will set these, not the user):
Click View>Form View, and you've got yourself an entry form. Use the left-right arrows at the bottom to move through the records, and the asterisk button to create a new record.
I know it's one of the limitation to use person column as lookup in another list but is there any work around ?
I have figured out a way using InfoPath forms on a list. It's a little involved. Are you still interested?
The basics involve setting up a secondary data connection to the lookup list and using rules in InfoPath to populate the people picker fields (DisplayName, AccountID, AccountType).
I've also found that you have to hide the people picker controls until there is data in them, otherwise they don't display anything even though there is data in the underlying fields.
I could spend a little time documenting the procedure if you need it.
-Doug