My advice would be to put the problem aside for a month and get some basic C++ under your belt first. Look for a book called "Accelerated C++".
Hacking away at the problem one post at a time on a forum isn't going to produce a meaningful product at the end of it, and isn't going to be done any quicker either.
From what you've said, it sounds like you're modifying a rather extensive existing program, in which case your newbie-ish hackery is just going to be a future maintenance nightmare.
That is assuming your employer knows that you don't know C++, and will understand your request for learning time. If on the other hand you claimed some C++ skill and they've called your bluff, well then that's your problem to deal with. Using a forum to get others to do your job for free isn't the way to go.
Yes you are right, I am a newb, however the company does know this.. Currently studying a degree in electronics in my spare time, and we havent really gotten into depths of c++ in the course (not to mention the course is distance learning and is done in my spare time) I have been hacking away at this and a few other things like automated testing procedures(these of which aren't that bad - mainly because i see what was done in the previous ones).
I have that sam's tech yourself c++ in 21 days, is that c++ accelerated book any decent?
Anyways, the code i have thus far for where i need this to go is...
//---------------------------------------------------------------------------
void __fastcall TStockTransferForm::Button2Click(TObject *Sender)
{
TListItem *aListItem2;
TQuery *aQuery = NULL;
TQuery *aQuery2 = NULL;
AnsiString asType, asStr;
AnsiString asPartnum, asQuantity, asRefnum;
//int iRef to be the incrementing integer..
TransferListView->Items->Clear();
aQuery2 = new TQuery( NULL ); //query to find partcode, and also SM Feeder type
aQuery2->DatabaseName = DataModuleForm->AutoQDatabase->DatabaseName;
aQuery2->SQL->Add( "select * from aq_part join aq_footprint on aq_part.part_ftprintcode = aq_footprint.ftprintcode where aq_part.partcode = :p0" );
aQuery = new TQuery( NULL ); //query to find reference layfile code
aQuery->DatabaseName = DataModuleForm->EfacsDatabase->DatabaseName;
aQuery->SQL->Add( "select * from transact where tratype = 'MTP' and traloc = 'SM-Q' and trasource = 'RLS' and traref = :p0 order by trapart asc " );
asStr = "PRO";
asStr += AnsiString:

tringOfChar('0', 6-ReferenceEdit->Text.Length());
asStr += ReferenceEdit->Text;
aQuery->Params->Items[0]->AsString = asStr;
aQuery->Open();
aQuery->First();
for ( int i=0 ; i<aQuery->RecordCount ; i++ )
{
aListItem2 = TransferListView->Items->Add();
aListItem2->Caption = aQuery->FieldValues["trapart"];
aListItem2->SubItems->Add( aQuery->FieldValues[ "TRAQUANT" ] );
aQuery2->Params->Items[0]->AsString = aQuery->FieldValues["trapart"];
aQuery2->Open();
aQuery2->First();
if ( aQuery2->RecordCount )
{
aListItem2->SubItems->Add( aQuery2->FieldValues[ "FTPRINTTYPE" ] );
}
else
{
aListItem2->SubItems->Add( "NA" );
}
aListItem2->SubItems->Add( 1 );
aQuery->Next();
asPartnum = aQuery->FieldValues[ "trapart" ];
asQuantity = aQuery->FieldValues[ "TRAQUANT" ];
asRefnum = DateToStr(Date()) + "_" + iRef;
TransferStrings->Lines->Add( asPartnum + ", " + asQuantity + ", " + asRefnum );
}
delete aQuery;
delete aQuery2;
}
Tis a bunch of SQL and database stuff as you can "c"...Tbh, i know "mimmicking isn't the best way as you don't really learn the theory behind everything, but i think i have done pretty well so far.