Data selected from dropDown write data from column2 to textBox - vb.net

Thanks in advance for your help. I've searched the web and this site and I can't seem to find the answer I'm looking for.
Ok I have an access db with a table named docs. It has two columns. One named Docs and the other email. I know how to tell VB that a value of a texBox = The value selected from the dropDown that is mapped to the first column.
What I can't seem to get the code to do is: When the value is selected from the dropDown, it will make the value of textBox2 by selecting it from the next column over.
Basically if you select say Dr. Smith the value from the next column his email, Smith#abc.org would be the value of a textBox.
I hope I fully explained what I'm trying to achieve. Please let me know if any other information is needed. Again thank you all for an help you provide.
Aaron

Related

Identify Pivot Field using VBA

I am trying to write a macro which automatically identifies which field is the data taken from in a pivot.
I have some columns with different level of org information dragged under one another in "Row Labels" to create a structure. Now I need to identify which row in the pivot is linked to which field.
I am a self-taught coder and am very new to advanced vba so need some help.
How my pivots look
I am trying to get the name of the field in the blue circle
Thank you!
Nevermind guys, It was simpler than I thought. I am just an idiot for not figuring it out earlier.
Anyhow, the solution is that "ActiveCell.PivotField" returns the Pivot row's field.

Formula-based list for data validation

Please refer to the image attachment below. I want to ask for help regarding the semi-automation of the values D2:D6. Currently, they have the following formula:
=IF(C2="n/a",$D$12,IF(C2="","",IF(OR(TODAY()=C2,TODAY()>C2),$D$11,$D$10)))
Column C on the other hand has the following formula:
=IF(B2="n/a","N/A",IF(B2="","",$B$8-$B2))
Basically, what these formulas do is that after I input a value 'x' at column B, column C automatically indicates the date 'x' days before the start date on B8. Column D then indicates whether the deadline is due, not due, not applicable, or ready (D2:D6 is data validated with a list including D9:D13).
However, if a certain action is already completed, the "Ready" option is manually selected from the drop down list, which then erases the formula. What I wish to ask for help with is how do I return the erased formula in case the "Ready" option is just accidentally selected, or if my (not excel-capable) peers will need to reuse the form by just deleting items in column A and B.
What I tried doing was making the formula itself an option in the drop down list, but this doesn't adjust to the cell addresses for each item, and only shows one static value.
One option I thought of was to limit the data validation list with just the "Ready" option, so that the user can just delete the cell. A VBA code will then detect the blank cell and will return the formula it initially had. Unfortunately, I don't really know VBA or any programming. I can however understand and have managed to use and modify VBA codes posted in the internet according to my previous needs. I tried searching for a code, but to no avail.
If you could give me good references (not a whole book please) relative to this, I would really appreciate it. If you're feeling benevolent and help me with the coding, thanks! However, if there's a non-VBA solution, then I would really like to know more about this. Thanks all!
Sample list

MS Access enter parameter value for report

I have a report/letter with a query as its record source.
Some of the paragraphs I would like the user to be able to amend instead of asking each time it needs a change.
I set up a local table called LetterWording; this has one record with four short text fields which contain the wording for the paragraphs which need amending.
In the letter I added textboxes for these paragraphs with the control source pointing at the relevant field (e.g. =[LetterWording]![1stInterviewParagraph1]).
However, when I open up the letter in report view I get the Enter Parameter Value popup asking for LetterWording.
If I click OK without entering anything (I don't know what it wants anyway) the letter opens and those four paragraphs say #Error.
Can anybody please advise what I'm doing wrong here?
Thank you!
Just me being silly. As I can't/don't want to add to the original record source query I should add these paragraphs as sub-reports.

Insert into datagridview column specific values in vb net

i am developing an app for windows in vb net.
I am stuck in the last part which is the following and i would like some help on to where should i look or do.My question:I have one database in mysql called patient.each patient have the usual columns(name,surname etc..).Apart from all the columns there is one column called 'time' and another one called 'date'.I have also one datagrid where these values are displayed.When a new user is to be added,all the fields are filled and in the 'time' he fills the time of visit.I would like to ask if there is any way to restrict the range of time according to date...for example to be able in the beginning before adding the new patient,to say that in august 30 of 2014 the range of time for appointments is from 9 to 10.So when the new patient is added on that date ,to book only between this range every ten minutes eg 9:10,then 9:20 and so on until 10.
I am really stuck and been searching the last week for a solution ,so any ideas on the implementation would be appreciated.
Thank you in advance..If you need some of my code let me know.
If you want to restrict the input data, you have to use the DataGridView's CellValidating event. There you can check wether the input is ok or not. If it's not ok, you can set the ErrorText field of the edited row, where you can explain to the user what's wrong with his input.
Have a look at this HowTo from the MSDN.

Need help: Chart Web part and list header style in SP 2010

I have 2 questions here, please help me.
First one, i would like to know on what basis Chart Web part y-axis columns are taken. why i could not get my own site columns in Y-axis. Please refer the below image.
Second question, i have created a list but when i add Description & Comments (multiple text) fields, the text color is coming differently. The text color is not matching with the other list column names. Please let me know how to correct this..??
Thanks for your guidance & help.
Y field will have to be numeric. X field can be any type. This would make sense, because if it is not numeric how will you show it in the chart? if the column is a choice column, etc. you can create a calculated column that reflects the original column but outputs a number.
Description and Comments are coming up as different because they cannot be sorted or filtered. They are there to provice a visual indication to the end user. you can ofcourse change them usign CSS/jquery...