By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,482 Members | 3,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,482 IT Pros & Developers. It's quick & easy.

Auto Assign Value Based On Another Field's Value

P: n/a
Hi all:

I have a subform called sfrmFootnotes linked to main Form frmFeeInput
(the latter based on tblFees).

tlkpFootnotes contains the PK for Footnotes.
tjnCode_Footnotes is a join table between tlkpFootnotes and tblFees
which contains FK_Code & FK_Footnotes [unique Index set for these 2

I need to auto-assign Footnotes like so:

If the last character of txtDescription = "*", then I want to Insert a
footnote whose PK = 1 into the subform.

If the last 2 characters of txtDescription = "**", then I want to
Insert a footnote whose PK = 2 into the subform.


Dim sSQL As String

If Right (Me.txtDescription,1) = "*" Then

sSQL = "INSERT INTO tjnCode_Footnotes (FK_Footnote, FK_Fees)" & _
" SELECT tlkpFootnotes.PK_Footnotes, Forms!frmFeeInput!PK_Fees"
& _
" AS IntCode" & _
" FROM tlkpFootnotes" & _
" WHERE tlkpFootnotes.PK_Footnotes = '1'"
DoCmd.RunSQL (sSQL)


Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.