326

(4 replies, posted in General)

humblelion,

Are you having a problem trying to calculate the sales value or the quantity sold?

Are you using a calculated column to work out your sales?

327

(6 replies, posted in General)

Hi Derek, thanks for looking at the project.

It is still a work-in-progress. Just a warning, if you click the 'Add Order' button, your email client will open.

328

(6 replies, posted in General)

I have hit a strange problem which only has become apparent after I installed v6.2 .

I have a form on which is placed a  Page Control. This control has three tabs.

On tab 2, along with some edit boxes and labels I have placed a Date Time Picker. The picker is appearing on all three tab layouts instead of just the layout of tab 2.

I don't recall this happening with the earlier builds of MVD.

I'm assuming that to solve this problem I'll have to instantiate the date time picker in code rather than from design time or delve into the Forms.xml file and physically move the control into the Tab 2 group.

Any thoughts?

I wonder if you should have

with FORM_NAME.imgList16 do //Eg: frmMain.imgList16
begin
  Masked    :=false;
  ColorDepth:=cd32bit;
  ...
end;

Thank you very much Dmitry, that worked a treat.

Hello,

I am having a problem  working out how to delete an item in a database from an entry in a combobox.

What I'm trying to do is to select an item from a combobox and then click on a button to delete the entry out of both the database and the combobox itself.

The code I currently have is:

procedure frmMain_btnDeleteSupplier_OnClick (Sender: TObject; var Cancel: boolean);
var
    item: integer;
    idx:string;

begin
  
  idx := frmMain.ComboBox2.text;  //get the entry selected from the combobox

{  frmMain.ComboBox2.dbDeleteRecord(16);}  // I feel I should be able to use this somehow
  
  showmessage('Item ' + idx); // shows a message box just for debugging purposes. At this point the correct item shows in the message

  
 frmMain.ComboBox2.dbSQLExecute('DELETE FROM supplier WHERE sup_name =' + idx); //Delete the selected item from the database

 frmMain.ComboBox2.dbUpdate; //Update the database and possibly the combobox
end;

One of my problems is, the above SQL produces and error message 'no such column: item text that I've selected

If someone could point me in the right direction I'd be very grateful.

Do I need to somehow read in the row ID from the DB and then use 'dbDeleteRecord(rowID)'? If so I'm not sure how to do that in MVD.

I am using the trial version 6.1.