473,320 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Auto Assign Value Based On Another Field's Value

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
fields).

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.

**SOMETHING LIKE**

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)

Thanks!

amy
==
Nov 13 '05 #1
0 1396

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David P. Donahue | last post by:
I'm using the following code to add a row to a table (for holding images) in my database (obtained from http://www.codeproject.com/aspnet/image_asp.asp?df=100&forumid=38225&select=1038401): ...
11
by: csomberg | last post by:
SQL 2000 I thought I would throw this out there for some feedback from others. I'd like to know if you feel using MS auto-increment field is a good solution these days or should one grow their...
1
by: ogilby1 | last post by:
Using an immediate if to fill a field on a form based on the value of another field. During data entry on the form this methodology works well. When looking at the results in the datasheet view or...
0
by: BK | last post by:
Hi, I have a problem. I need to auto populate fields based on a value entered in combo box. Initially, I put all the required fields in the combo box, and hide it (set to 0",0",0", ...), then...
2
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings...
3
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table)...
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
2
by: dougloj | last post by:
Hi. I have an ASP.NET application written in C#. To log in, a user must provide their email address and password. I already give the user a "Remember my Email Address" check box. If they check...
1
DebadattaMishra
by: DebadattaMishra | last post by:
Introduction In case of rich applications, you must have observed that a text field behaves like a dynamic combo box. When the user enters some characters in the text field, a popup will come up...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.