473,405 Members | 2,300 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,405 software developers and data experts.

Validating same records from two different tables

Hello Everybody

I have two tables(and the corresponding forms) with following fields

Table 1 (Form1)
Field1
Field2
Field3

Table 2 (Form2)
Field1
Field2
Field3
Field4
.......
Field10

When the user enter the values for Field1,Field2,Field3 in Table2 or
rather in Form2, I want to do a validation check for those values from
Table1. If the values match with the corresponding records in Table1,
it should let the user to proceed to Field4 in table2, else it should
through an error message. (Please note that the Table1 is data entered
before Table2)
Is it possible to do this, if so can annybody please help me through
with this problem.
Thanks for all your help.
I realy appreciate it

Regards
Nov 13 '05 #1
1 1400
On 4 Nov 2004 04:59:43 -0800, ta*******@yahoo.com (anita) wrote:

You could use DLookup to check. For example in the
Form2.Field3.AfterUpdate you could write:
if IsNull(DLookup("Field1", "Table1", "Field1=" & txtField1 & " AND
Field2=" & txtField2 & " AND Field3=" & txtField3")) then MsgBox "Bad
Boy!"

What this does is lookup any value (I would use the PrimaryKey value)
from Table1 given the values of the 3 fields. If any of these fields
are text rather than numbers, you have to wrap the values with single
quotes like this:
"Field1='" & txtField1 & "' AND...

If Table1 has many rows, say > 1000, DLookup may be too slow, and you
should write your own query to essentially do the same. Of course you
will have Table1 properly indexed with a unique index across the 3
fields.

-Tom.

Hello Everybody

I have two tables(and the corresponding forms) with following fields

Table 1 (Form1)
Field1
Field2
Field3

Table 2 (Form2)
Field1
Field2
Field3
Field4
......
Field10

When the user enter the values for Field1,Field2,Field3 in Table2 or
rather in Form2, I want to do a validation check for those values from
Table1. If the values match with the corresponding records in Table1,
it should let the user to proceed to Field4 in table2, else it should
through an error message. (Please note that the Table1 is data entered
before Table2)
Is it possible to do this, if so can annybody please help me through
with this problem.
Thanks for all your help.
I realy appreciate it

Regards


Nov 13 '05 #2

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

Similar topics

8
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
4
by: KT | last post by:
Is there any one click solution that would do the trick? I would like to create a button, so the person who maintains the database can perform clean up work to delete duplicate records which...
7
by: Ray | last post by:
I have a input form linked to a table and found the total no of records on the bottom bar is different from that of table. Can someone advise an effective way to find out the different records...
35
by: deko | last post by:
Do I get more scalability if I split my database? The way I calculate things now, I'll be lucky to get 100,000 records in my Access 2003 mdb. Here some math: Max mdb/mde size = 2000 x 1024 =...
2
by: mattytee123 | last post by:
I have about 20 tables, of which I would like to do a union query and count of how many of each different code there is? The simplified verson of the table is structured like this. Code ...
3
by: Matt | last post by:
Using ASP and Access is it possible for me to update recordsets in two different tables from data collection in one page? Basically, I need user input on 1 page that contains multiple form field...
2
by: Steve Cartnal | last post by:
I need to copy records from several different tables into one text file. Although the tables have many common fields, they also contain several that are different from table to table. I can copy...
1
by: bluereign | last post by:
Thank you for your assistance. I am a novice looking to JOIN and append or combine records from 2 current Tables into 2 new Tables named below. I have been able to JOIN Tables with the script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.