Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rookie - form calcs with data from table and query

Status
Not open for further replies.

jcbrad

IS-IT--Management
Apr 4, 2009
2
US
I'm a total rookie here.
I'm creating a loan tracking system.
Core table
Core form
Pmt_Mod table
Pmt_Mod form
rtrv_rec query

The Pmt_Mod form needs data from specific records in Core table to do some calcs and populate fields back into Pmt_Mod table. I've created a query to retrive the appropriate records from Core (rtrv_rec). When I go into visual basic for the Pmt_Mod form through, say "click" on the Property Sheet, and build an "event process" I can't figure out the syntax to reference the fields in the rtrv_rec query. What I want to do is set some of the pmt_mod fields = to corresponding query fields, do some financial math on them, save them back to the Pmt_Mod table throught the Pmt_Mod form.

Private Sub WCRA_ID_LostFocus()
[pInt_Rate] = [rtrv_rec]![INT_RATE]
End Sub

where pInt_Rate is a field in Pmt_Mod table
and INT_RATE is a field in rtrv_rec query




Thanks in advance

Rookie.


 
You probably should be using an Update query to update your records unless you are trying to enter a field on data entry.

Going down your path, you might consider Dlookup function since this is just one value. Otherwise you should consider using a Recordset if you need multiple values (dlookup is slower than using recordsets).

Also taking two steps back, you probably should read the first three rules of data normalization to make sure your database is structured correctly. There are 5 main rules but there are circumstances not to use rules beyond the first three and more significantly they are a lot more difficult to understand.
 
I will give your ideas a try. thanks. I've looked over both Recordset and Dlookup but apparently not deeply enough.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top