Search results

  1. T

    the table is already opened exclusively by another user

    So I have a create table query in vba and there's a problem with the RemoveVol line, (I've only shown this part as substantial code). In the event that the iif goes down the iMaxWithReconstitutionMinLimit function (custom function) the table fails to fill in the RemoveVol column and subsequent...
  2. T

    Best approach to calculate if required dose possible from multiple different stock sizes

    We have a manual process where if a 250mg dose of Drug A is required, we give 120mg + 75mg + 55mg as 3 separate doses, or (2 x 75mg) + 100mg, or (2 x 80mg) + 90mg What I'm after is the best way to calculate if the available dose is divisible by any combination of 120mg, 100mg, 90mg, 80mg, 75mg...
  3. T

    Refreshing a form in another session

    Hi All, We have an Access front end with SQL Server backend. What I want to achieve is when a user in the pharmacy performs an action to say treatment is ready (table updated) the form that appears on the ward (and run on a separate PC) gets refreshed to inform them that treatment is ready. I...
  4. T

    Function Reference an Arguement

    Hi All, Really thought this was going to be straightforward but: I have a function that I want to return the number of a consumable to use. The function is run through a query There's 30 consumables C1 to C30 If the DLookup is true I want to return the corresponding consumable e.g. e.g...
  5. T

    Function in query criteria

    Hi All, I have below function that is used return a field name depending on which form is open (which type of stock is being booked in) Public Function WhichStockEntryFormIsOpen(FieldName As String) As Variant If CurrentProject.AllForms("frmStockEntry").IsLoaded Then...
  6. T

    Can't set focus error or OpenForm action canceled error

    Hi All, Apologies for the bad explanation. I have a some code used to test frmChemoRecord, it loops through various scenarios completing the form with a range of different values to test the output. The problem comes when it gets to the DoCmd.OpenForm "frmDateSelect", acNormal, , , ...
  7. T

    Ignore query criteria if form not open

    Hi All, I have multiple forms for entering different types of stock onto a database, when entering, a query looks up stock already on the database for that product. To make life simplier I want one query with the criteria for product something like: [Forms]![frmStockEntry].[Product] Or...
  8. T

    Run time error 13 on End Function

    Hi All, I have a function that I want to export as an array. I've limited the code to the Type Mismatch error Public Function BatchProductionVial1(DrugName As String, DrugRoute As String, DrugDose As Double, DrugBatchSize As Integer) As Variant Dim returnVal(3) As Variant...
  9. T

    Dates Confusion in VBA

    Hi All, I had a bit of code that ran in the run up to Christmas. If Date >= Format("01/12/" & Year(Date), "dd/mm/yyyy") And Date < Format("25/12/" & Year(Date), "dd/mm/yyyy") ThenThis didn't work after the 1st December passed, the solution was Format(Date, "dd/mm/yyyy") >= Format("01/12/" &...
  10. T

    iif statement with query criteria

    Hi All, I have a Form frmAuditTrail, it has three combo boxes in the header (Username, Area & Action) What I'm attempting to do is if an Area is selected then I want the Combo box for Action to only list Actions associated with the Area. The difficulty comes when if no Area is select then I...
  11. T

    Continous Form vba changing label

    Hi All, I have a continuous form for entering drugs for each drug it has a combobox to select frequency (Day, Week, Month, Year) I would like the result of this field to change the label for just that record. There's a bit of vba that adds and "s" and changes the unbound text box. I did...
  12. T

    Use VBA code to Replace other VBA code

    Hi All, In brief I need to press a button that will disable the MsgBox's, then I need the database to run through a large set of test data to check the output. In normal circumstances the operator would be present, but for testing I just need to run the data and review the results without it...
  13. T

    Altering SQL Linked table from VBA

    Hi All, Recently upsized Access Db to SQL Server. One issue we have is if somebody added a new drug to the access database it creates a new column in the Access table. CurrentDb.Execute ("ALTER TABLE tblDrugListOral ADD COLUMN " & DrugNameWithOutSpace & " Number;") Problem is now the...
  14. T

    Update SQL for timestamp only treatments that are ready

    Hi Folks, We have a tracking system for chemotherapy when all the treatments for that day are ready an UPDATE SQL query is run to set the status of all patients drugs to ready for collection. ReadyForCollectionSQL = "UPDATE tblChemoRecord SET tblChemoRecord.ReadyForCollection = Now() "...
  15. T

    Error handling with loop

    Hi All, I've got a problem with a loop for producing worksheets (reports). When everything works there's no problem but when one of the reports namely rptChemoOralWorksheet doesn't have data available to produce the report the loop finishes and then all remaining worksheets don't print. I've...
  16. T

    Removing text from string using Replace() & wildcards

    Hi Guys & Girls, I have a list of consumables; Syringe 50ml Syringe 20ml Syringe 5ml Syringe Cap White Needle I want to remove only the number and the ml part from the list, so I would end up with; Syringe Syringe Syringe Syringe Cap White Needle If I use...
  17. T

    Best way / work around around to handle a zero results query

    Hi Ladies & Gentleman, I have several create table (atblStockLiveShortExpiry1) queries that where stock is required (& available) returns a result that is the shortest dated stock to be used later in my code. I'm now looking to change the code so that the manufacturers in each of the created...
  18. T

    Struggling with SQL in VBA

    Hi Folks, I've created an update query in access and it works as expected: UPDATE atblChemoPreCompoundOrder SET atblChemoPreCompoundOrder.Patient = [Forms].[frmChemoRecord].[Patient], atblChemoPreCompoundOrder.[Patient Number] = [Forms].[frmChemoRecord].[Patient Number] WHERE...
  19. T

    Problem with DLookup

    I'm struggling with what should be a simple problem: This works: PreCompoundedLookupUnused = Nz(DLookup("[DoseRequired1]", "atblChemoPreCompoundOrder", "[Preparation]='" & Me![PreparationNotVisible] & "' And StockReceived = -1 And StockUsed = 0 And NextCycleDue < Date-8"), "")However when I add...
  20. T

    Scanning barcodes to track items while using other database functions

    Hi Guys, I can use barcode scanning to track items through the process, on the condition that the relevant field on a form is highlighted. The issue is I want the scanning/tracking with wireless scanners to be going on in the background while an operator can use the other functions of the...
Top Bottom