I have one cardbox database1 containing data ( Forename, Surname DOB etc ) I have new information containing similar data but with additional information in an excel file(Forename, Surname, DOB, Ref No, Policy No etc. I am trying to match the names with DOB in order to link the data and update the records.
I have created matching fields in the native field but when I import it does not import into the fields I had linked, I even created another cardbox database to try and resolve this issue
ONLY with the latest build of Cardbox Client (4263) you can use added Excel macro.
This macro does:
--update the Cardbox record when there is one occurrence of a name
--add a record when there is zero records of the name
--let you decide which record is update when there are > then 1 name in the Cardbox db.
In this example (yes I know its quick and dirty):
--change the servername
--change database name
--column A is used for the name, is also selection term in Cardbox ; change it if relevant
--add lines for other columns - field place is here in Excel column 2.
Example: cbr.fields("PL") = Cells(ActiveCell.Row, 2).Text
--it starts on the current Excel row, it ends when next lime is empty.
I tested it, this works.
Set CBX = CreateObject("Cardbox.Application")
Set cbwin = CBX.Windows
Set cbfil = cbwin.OpenFile("cardbox://SERVERNAME/" & "DATABASENAME", 0, "master profile", "password")
cbfil.Select "NA", Cells(ActiveCell.Row, 1)
If cbfil.RecordCount > 1 Then
CBX.Visible = True
CBX.MacroMethods.PlayText "Pause ""Set cursor on right record, then push ok"" "
rp = cbfil.RecordPosition
CBX.Visible = False
If cbfil.RecordCount = 0 Then
Set cbr = cbfil.Database.NewRecord
cbr.fields("NA") = Cells(ActiveCell.Row, 1).Text
If rp = 0 Then rp = 1
Set cbr = cbfil.Records.Item(rp)
cbr.fields("PL") = Cells(ActiveCell.Row, 2).Text
'field xx = excel column 3: cbr.fields("PL") = Cells(ActiveCell.Row, 3).Text etc etc
If Cells(ActiveCell.Row + 1, 1) = "" Then
cbfil.SelectionLevel = 0
rp = 0