4 text boxes and a funeral

baldeagle

Registered User.
Local time
Today, 02:36
Joined
Nov 9, 2004
Messages
38
Howdy,

I have the following two tables:

1) | A | B | C | D |

2) | A | B | C | E |.

Table #1 is a list of previous product, so all the fields are known. Table #2 is input by the user - after updating text C, I would like to have text E automatically fill in with the matching value from column D. I might be able to do it with cascading combo boxes, but would prefer to do it with only the text boxes.

Thank you,
Baldeagle.


P. S. I've been lurking in the forums for a while and have learned much. Sorry if this post is unclear - It the first forum I've posted to in a few years.
 
What code do you have?
Are the text boxes bound?
Any other interaction from the user?
Is it meant to display from one table and store in the other?


Vince
 
What code do you have?
Currently, None.
Are the text boxes bound?
The text boxes are bound to table #1. So the users are inputing data into Table #1: columns A, B & C. I want #1 column D to be referanced from table #2 column E, and automatically filled in. (Basically table #2 E = table #1 D.)
Any other interaction from the user?
Not really
Is it meant to display from one table and store in the other?
It is meant to take 3 fields from one table, look up the matching 3 fields in another table, and copy a value between the two.

Vince
 
If you use code on, probably on a button press (although you can run from AfterUpdate)...

Open a recordset with the table two and search criteria
Check if you have record(s) returned.
- If so put the first one into the fourth box
- If not - tell user?
close recordset

Code:
dim rst as adodb.recordset

set rst = new adodb.recordset
strSql="Select field4 from tblTwo where field1='" & txtField1 & "' and field2='" & txtField2 & "' and field3='" & txtField3 & "'"
rst.open strSql, currentproject.connection,3,3,1 'static,optimistic,adcmdtext
if rst.eof
  mgsbox "No records"
else
  txtField4 = rst("field4")
end if
rst.close
set rst = nothing
The code aould look a little like that, with the appropriate names for textboxes,tables and fields.


Vince
 

Users who are viewing this thread

Back
Top Bottom