Recent content by Brian1960

  1. B

    SQL Server Function Error

    Hi, I have an Access front end with a SQL Server backend and need to able to call a User define function in a query. To do this I need to create the function but I can't get the right syntax. CREATE FUNCTION BCL_GetForeignKeyCode(@param1 as varchar(16)) RETURNS Integer AS BEGIN declare...
  2. B

    doCmd OutputTo excel (trims varchars)

    If you open the table and Analyse with Excel, then it shows all the text. Excel is not limited to 255 char per cell. Test it to see.
  3. B

    doCmd OutputTo excel (trims varchars)

    HI, I have code which exports a table to a spreadsheet. It works fine apart from a Varchar 5000 field (from a SQL server) which is only shows the first 255 characters, when it opens the Excel Spreadsheet. I have checked the orginal table (which is created on the fly) and it has all the data...
  4. B

    How do I crete read only fields in a query?

    Form Security Whe you display the data in the form make sure that the fields are all locked apart from the 2 you need to have the users edit.
  5. B

    mapping Drives

    UNC v Mapped Path I amn't a fan of UNC links. BUT Open the front end and delete all the links then add them back using UNC paths instead of mapped drives. The problem arises when your IT team buy a new server. No links will work. Easier to run a BAT file logging on script that ensures each user...
  6. B

    Counter Help

    Counting Okay so we now have two bound controls and they multply to give third. If the third box is bound then why? We then have a fourth control as a counter (bound?). Is this right? 4 controls on a form. The first two are bound to a table. txtBox1 txtBox2 This third can be bound as well...
  7. B

    Counter Help

    Counter The code I sent was for unbound text boxes. If you add the code to the LostFocus event of the txtBoxA it works fine.
  8. B

    Counter Help

    Use Events On the txtboxA use an event after change and run code If isNumeric(txtboxA ) and txtboxA >0 then txtBoxCount = txtBoxCount + txtboxA Me.refresh ' this may be me.requery End if
  9. B

    Remember Tab After Close

    Remember Location I amn't sure if you can remember the tab but basically it is probably the same as this. Whe you click to open the other form, send as part of the open, the current record ID or tab you were in to the new form, when you go back to the previous form you can open at that record...
  10. B

    Disable Ctrl + ' Keystroke

    Solution For every key down event check if there is a Ctrl Key and the if there is check if there is a KeyCode of 192 (') if it then set it to 0.;) Private Sub MemoBox_KeyDown(KeyCode As Integer, Shift As Integer) 'MsgBox KeyCode If Shift = acCtrlMask Then If KeyCode = 192 Then...
  11. B

    Disable Ctrl + ' Keystroke

    Captue Keycode What I want to trap and prevent is Ctrl + ' but allow Ctrl + ; and I can't seem to work out which event to use or apture the two key press. If I trap on key press then when the user presses Ctrl it traps but we need to wait to see the second key. I am at a loss and have searched...
  12. B

    Combobox & BIT field @ different sql server (english & spanish)

    BIT field Make sure that in you development server very record with a BIT field has value. SQL Server does not allow Null values in a BIT field (0 or 1).
  13. B

    transfer unbound value from form to form

    Open New Form Enter this into the onClick even of the btnAddInvoice Button. DoCmd.OpenForm "frmNewInvoice", acNormal Forms("frmNewInvoice").cboAccountRef= Me.cboAccount You could have the form open but hidden , acHidden Then set it it to visible when filled but frankly I never bother as...
  14. B

    Autofill Fields in Form

    Use an event The easiest way is to use an event such as LostFocus or OnChange to trigger the different options and then do a refresh. Private Sub cboScope_Change() Me.OtherObject.Value = Me.cboScope.Column(2) Me.WageRate = Me.cboScope.Column(3) End Sub You can also use the dateadd...
  15. B

    Help needed on filtering a form

    Return BuddyID as well Try something like this. Change the BuddyID to the required field name. To Dim RetVal As Long Dim RetValBuddyID As Long RetVal = Nz(DLookup("RepID", "tblreps", "NTLogin ='" & Environ("UserName") & "'"), -1) RetValBuddyID =...
Top Bottom