473,466 Members | 1,443 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

removing incomplete records

Some of the people are requiring a personID to be in the records and
of course formatted as 001 002....etc so its a text field.
Now they are also skipping this field and putting in stuff and just
quitting out...leaving junk records in the tables.

at first I tried this
Private Sub Form_Unload(Cancel As Integer)

Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("tblRegistrationMain",
dbOpenDynaset)
rst.FindFirst "[PrimarySector] = null"
Do While Not rst.NoMatch
rst.Delete
rst.FindNext "[PrimarySector] = null"
Loop

rst.close
End Sub

I thought this should work but again its a darn text field..

what do I need to do to find an empty text field?

thanks for any pointers on this
Jan 22 '08 #1
4 2603
On Jan 22, 2:22*pm, sparks <jstal...@swbell.netwrote:
Some of the people are requiring a personID to be in the records and
of course formatted as 001 002....etc so its a text field.
Now they are also skipping this field and putting in stuff and just
quitting out...leaving junk records in the tables.

at first *I tried this

Private Sub Form_Unload(Cancel As Integer)

Dim rst As Recordset
*Set rst = CurrentDb.OpenRecordset("tblRegistrationMain",
dbOpenDynaset)
* * * * rst.FindFirst "[PrimarySector] = null"
* * * * Do While Not rst.NoMatch
* * * * * * * *rst.Delete
* * * * * * * *rst.FindNext "[PrimarySector] = null"
* * * * Loop

rst.close
End Sub

I thought this should work but again its a darn text field..

what do I need to do to find an empty text field?

thanks for any pointers on this
Why not make the field rewuired in the underlying table then
'incomplete' records cannot be entered at all. No code required.
Jan 22 '08 #2
On Jan 22, 2:22*pm, sparks <jstal...@swbell.netwrote:
Some of the people are requiring a personID to be in the records and
of course formatted as 001 002....etc so its a text field.
Now they are also skipping this field and putting in stuff and just
quitting out...leaving junk records in the tables.

at first *I tried this

Private Sub Form_Unload(Cancel As Integer)

Dim rst As Recordset
*Set rst = CurrentDb.OpenRecordset("tblRegistrationMain",
dbOpenDynaset)
* * * * rst.FindFirst "[PrimarySector] = null"
* * * * Do While Not rst.NoMatch
* * * * * * * *rst.Delete
* * * * * * * *rst.FindNext "[PrimarySector] = null"
* * * * Loop

rst.close
End Sub

I thought this should work but again its a darn text field..

what do I need to do to find an empty text field?

thanks for any pointers on this
REQUIRED oops...
Jan 22 '08 #3
On Tue, 22 Jan 2008 19:22:22 GMT, sparks <js******@swbell.netwrote:
>Some of the people are requiring a personID to be in the records and
of course formatted as 001 002....etc so its a text field.
Now they are also skipping this field and putting in stuff and just
quitting out...leaving junk records in the tables.

at first I tried this
Private Sub Form_Unload(Cancel As Integer)

Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("tblRegistrationMain",
dbOpenDynaset)
rst.FindFirst "[PrimarySector] = null"
Do While Not rst.NoMatch
rst.Delete
rst.FindNext "[PrimarySector] = null"
Loop

rst.close
End Sub

I thought this should work but again its a darn text field..

what do I need to do to find an empty text field?

thanks for any pointers on this
================================================
I hope that something like this will work.
your idea is sound but they won't get the feedback on what and why.

Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim response As Integer
Dim rst As Recordset

SaveIt = True
If Dirty Then
Cancel = False
If IsNull(PrimarySector) Then
response = MsgBox("Cannot save a record with no PrimarySector" &
vbCr & _
"Do you want to delete this record?", vbYesNoCancel)
Select Case response
Case vbNo
Cancel = True
PrimarySector.SetFocus
Case vbYes
SaveIt = False
Case vbCancel
Cancel = True
PrimarySector.SetFocus
End Select
End If
End If
End Sub
I hope this does it.
please understand that these people will argue with the moon. IF
somehow their record is not there or they think they did it right and
we don't tell them in a polite way they might have made a mistake then
we are a holes..
========
========
"tell them in a polite way they might have made a mistake "
this is pushing it

Jan 22 '08 #4
On Jan 22, 3:05*pm, sparks <jstal...@swbell.netwrote:
On Tue, 22 Jan 2008 19:22:22 GMT, sparks <jstal...@swbell.netwrote:
Some of the people are requiring a personID to be in the records and
of course formatted as 001 002....etc so its a text field.
Now they are also skipping this field and putting in stuff and just
quitting out...leaving junk records in the tables.
at first *I tried this
Private Sub Form_Unload(Cancel As Integer)
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("tblRegistrationMain",
dbOpenDynaset)
* * * *rst.FindFirst "[PrimarySector] = null"
* * * *Do While Not rst.NoMatch
* * * * * * * rst.Delete
* * * * * * * rst.FindNext "[PrimarySector] = null"
* * * *Loop
rst.close
End Sub
I thought this should work but again its a darn text field..
what do I need to do to find an empty text field?
thanks for any pointers on this

================================================
I hope that something like this will work.
your idea is sound but they won't get the feedback on what and why.

Private Sub Form_BeforeUpdate(Cancel As Integer)

* Dim response As Integer
* Dim rst As Recordset

* SaveIt = True
* If Dirty Then
* * Cancel = False
* * If IsNull(PrimarySector) Then
* * * response = MsgBox("Cannot save a record with no PrimarySector" &
vbCr & _
* * * * * * * * *"Do you want to delete this record?", vbYesNoCancel)
* * * Select Case response
* * * * Case vbNo
* * * * * Cancel = True
* * * * * PrimarySector.SetFocus
* * * * Case vbYes
* * * * * SaveIt = False
* * * * Case vbCancel
* * * * * Cancel = True
* * * * * PrimarySector.SetFocus
* * * End Select
* * End If
* End If
End Sub

I hope this does it.
please understand that these people will argue with the moon. IF
somehow their record is not there or they think they did it right and
we don't tell them in a polite way they might have made a mistake then
we are a holes..
========
========
"tell them in a polite way they might have made a mistake "
this is pushing it- Hide quoted text -

- Show quoted text -
They will get feedback if you code correctly to give them feedback.
Many ways to do this as well such as on the before insert event in
your form that is used to populate the table.
Jan 28 '08 #5

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

Similar topics

6
by: Sriram | last post by:
Hi SQL Server Experts, I really need some help ASAP.I thank you in advance. We have an ASP/MS SQL Server Shopping cart application,developed by an independent developer.We really have a...
4
by: Steve | last post by:
Hi, I have a table which contains records of user access and searches made within an application, this is a sample of the data: response for 101 results from database in 28906 ms I only...
1
by: Doug | last post by:
I have a Do-Loop routine that checks the values of certain fields in a Form (F_OmissionCheck) for omissions. If the field is blank, the strOmissions variable is modified with additional verbiage...
5
by: Paul F. Dietz | last post by:
Is the following legal C? struct foo; struct foo (*p); /* Pointer to array of 10 foo structures */ struct foo { int bar; int baz; }; main() { printf("%d\n", sizeof(*p)); } Paul Dietz...
7
by: Jim Carlock | last post by:
Looking for suggestions on how to handle bad words that might get passed in through $_GET variables. My first thoughts included using str_replace() to strip out such content, but then one ends...
3
by: Brian Graham | last post by:
I have a combo box with a query for a list of names etc. The table has 250,000 rows. The query returns 250,000 rows. But the list returns only 97,000 rows and then shows blank columns after that, so...
16
by: junky_fellow | last post by:
Is there any efficcient way of removing the newline character from the buffer read by fgets() ? Is there any library function that is similar to fgets() but also tells how many bytes it read...
1
by: PerumalSamy | last post by:
Hi I am having table with more 13 lakhs records. I am having duplicate records in it. i need to remove that. I wrote the following query SELECT *
4
by: robtyketto | last post by:
Greetings, I added my error checking (see code below) on the Form "On Current" event as I believe this code will run upon any action on screen being actioned. Errors happen when users are...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.