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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop appending this data!!!

Status
Not open for further replies.

tinymind

Programmer
Nov 9, 2000
90
GB
Fairly new and basic VB programmer ...

I have a very simple problem .. ..

I have two unbound forms with fields which users add data to.

I then have 3 tables to which this data is split into .. .. using 3 append queries, the problem is, using a button on the second form I want the users to add the data and only stop them if the data is already in table 1.

Table 1 has a unique field which is a concatenation of 3 fields on the forms and is linked to the other two tables as a one to many link.

I have set the warnings to "FALSE" in the VB of the button as to stop the users getting confused with all the prompts.

This has led to detail not being added to the Table 1 but adding them to the other 2 tables.

What am I doing wrong?
 
Well if I understand the problem I would try something like this:

Dim dbs as Database
Dim rst as Recordset
Set dbs=currentdb()
Set rst=dbs.openrecordset("table1")
rst.findfirst "[fieldname]= forms!formname!controlname&forms!formname!controlname&forms!formname!controlname"
if rst.nomatch then
...run append queries here
end if

run this from the click of the button
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top