Hi Everyone
Apologies for what might well be yet another novice question !
I have a form with a subform from which the user selects a record, which then populates the form.
The problem is that some (but not all) of the historical name, salutation and address fields in the original source database have stars in the fields after the name, salutation, etc., to denote that there was a comment regarding the record, etc. Some have no stars at all, others might have them against name and address 1, others against more of the address.
I am not permitted to remove these stars from the original source database, however we don't want these stars to be continued in the table which my form subsequently fills...
As an example, the Name will be in the database dbo.measurement, in a column called Name.
The name could be Mr J Smith***************
Meas_id and NumOrigId are the same reference number, just one is in the source database, the other on my form.
So far I've tried using DCount but I get an error message telling me that there are the wrong number of arguments or invalid property assignment. For example:
If DCount("*", "dbo_Measurement", "Name", "[Meas_id] = Forms!FrmRetestSearch.NumOrigId") > 0 Then
Me.TxtName = Replace(Me.TxtName, "*", "")
End If
If I just use Me.TxtName = Replace(Me.TxtName, "*", "") without any precursor if statement then when I test a record without any stars after the "name" then I get an error message, so I must have to use an if statement...
It doesn't help that stars are wildcards in VBA..
Please advise - how do I structure an if statement so that it finds where there is one or more stars in the name column of dbo_measurement against the meas_id / NumOrigId stated?
Thank you !
Kate
Apologies for what might well be yet another novice question !
I have a form with a subform from which the user selects a record, which then populates the form.
The problem is that some (but not all) of the historical name, salutation and address fields in the original source database have stars in the fields after the name, salutation, etc., to denote that there was a comment regarding the record, etc. Some have no stars at all, others might have them against name and address 1, others against more of the address.
I am not permitted to remove these stars from the original source database, however we don't want these stars to be continued in the table which my form subsequently fills...
As an example, the Name will be in the database dbo.measurement, in a column called Name.
The name could be Mr J Smith***************
Meas_id and NumOrigId are the same reference number, just one is in the source database, the other on my form.
So far I've tried using DCount but I get an error message telling me that there are the wrong number of arguments or invalid property assignment. For example:
If DCount("*", "dbo_Measurement", "Name", "[Meas_id] = Forms!FrmRetestSearch.NumOrigId") > 0 Then
Me.TxtName = Replace(Me.TxtName, "*", "")
End If
If I just use Me.TxtName = Replace(Me.TxtName, "*", "") without any precursor if statement then when I test a record without any stars after the "name" then I get an error message, so I must have to use an if statement...
It doesn't help that stars are wildcards in VBA..
Please advise - how do I structure an if statement so that it finds where there is one or more stars in the name column of dbo_measurement against the meas_id / NumOrigId stated?
Thank you !
Kate