Found a way with this code cheers. I know its cheating but it works!
'checks the searcable fields on the form and if empty, enters some default values
'This will allow the searches to return all fields.
'setup error routine
On Error Resume Next
If IsNull(Me.HDDSize.Value) Then
Me.HDDSize.Text = "Unknown"
If IsNull(Me.txt_IP.Value) Then
Me.txt_IP.Text = "Unknown"
If IsNull(Me.OS.Value) Then
Me.OS.ListIndex = 4
If IsNull(Me.com_processor.Value) Then
Me.com_processor.ListIndex = 6
If IsNull(Me.txt_user_now.Value) Then
Me.txt_user_now.Text = "No User"
If IsNull(Me.txt_user_next.Value) Then
Me.txt_user_next.Text = "No User"
If IsNull(Me.RAM.Value) Then
Me.RAM.ListIndex = 9
If IsNull(Me.txt_version_sw.Value) Then
Me.txt_version_sw.Text = "Version Unknown"
set the Required to yes
put some text in the valiation text
and check with the validation rule
hope this help
See clear as mud
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
How about using a delimited value in the tag attribute for textboxes you want to evaluate? The following untested snippet would assume you have textbox controls with tag properties similar to "validate; Enter Username" or "Validate; Unknown"
Dim valid As Boolean
Dim ctl As Control
Dim attr() As String
valid = True
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
attr = Split(ctl.Properties("tag"), ";")
If attr(0) = "validate" And Nz(ctl, "") = "" Then
valid = false
ctl = attr(1)
if valid = true then
'do whatever else it is you were planning here
'do whatever is global in the event of failing validation here