Search results

  1. VilaRestal

    Access Relationship Help!

    Everything looks good except: MovieActor table needs both fields as primary keys (combined makes the primary key). This will stop a movie having the same actor twice - it would be a duplicate primary key in MovieActor table and Access won't allow that. Going by the second image which is...
  2. VilaRestal

    Cascading Column Combo Boxes and Multiple Field Sources

    You still have to deal with the issue of the user changing a higher level combobox after already drilling down some of the way. And I don't like referencing control values in expressions. It's very inefficient and makes for nasty looking formulas with Access insisting on putting brackets all...
  3. VilaRestal

    Cascading Column Combo Boxes and Multiple Field Sources

    1. The same as you did before but for the AfterUpdate event of cbORequestTo setting the rowsource of cbCompany, he AfterUpdate event of cbCompany setting the rowsource of cboContact, etc, with ever more stringent where clauses combining the values of all higher comboboxes and perhaps including...
  4. VilaRestal

    Run Time Error: 91

    You definitely don't need to Set Sorted to True. It's a base type (boolean) so is assigned as you have done. nodNode.Root.Sorted = True should work but only if nodNode has actually been assigned to a Node. The error message you got indicates (in VBA's usual clear way) that it hasn't. That at...
  5. VilaRestal

    Setting a default image on a form

    I do feel compelled to point out that hard-wiring a default like this, a default that may well need to be changed and changed again, into code or form design isn't good practice. It's better to set it at table level because then it's centralised in a split database and doesn't require a new...
  6. VilaRestal

    Novice problems with Class Properties and Arrays. Likely syntax.

    That's a really cool demo to throw together lagbolt. Shows a quite sophisticated technique and principles of encapsulation in a neat package. It does, however, also show another principle: don't use classes unless they're really needed! Don't get me wrong, it's great to learn them and I know...
  7. VilaRestal

    Text Box with "#Name?" instead of text

    If you want a Textbox to display a string, let's say "Hello", you need to set its control source to ="Hello" If you set it to just Hello Access is looking for a field called Hello
  8. VilaRestal

    another form

    The other form can run code in this form in the same way: Make a public sub in Form 1 that does the remainder of the processing and takes as arguments all the details you need off Form 2 Form 1 opens Form 2 as a popup modal. In the close event (or equivalent, after validating the user's...
  9. VilaRestal

    Data from another form

    See my reply to your same question in the Forms forum: http://www.access-programmers.co.uk/forums/showthread.php?t=235414
  10. VilaRestal

    Set recordsource by a list of queries in combobox

    The only problem I see is that the columns are zero based so if this is the order of the columns in the combo box then their indexes are qryNameID = Column(0) qryName = Column(1) FriendlyqryName = Column(2) so your code should be: Me.RecordSource = Me.cboQueryPicker.Column(1)
  11. VilaRestal

    Order By property ignored, form ordered by different field

    Check that the Order By On Load property is True. It needs to be for the Order By property to have any effect.
  12. VilaRestal

    another form

    You can refer to the other form in code using either of these methods: Forms!NameOfForm or Forms("NameOfForm") so if the form is called DeliveryOptions and it has a textbox called Address you can read that into a string s with s = Forms!DeliveryOptions.Address or s =...
  13. VilaRestal

    Subform Index or Primary Key Cannot Contain Null Value

    The subform is based on the Registration table. Its primary key is not an autonumber so needs to be added manually. There's nowhere in the subform to do that. So, add the RegistrationNo field to the subform. However, because the subform is based on the same table (Registration) as the parent...
  14. VilaRestal

    Is there any way to mix tow logical condition in docmd.openForm criteria?

    Numbers don't need quotes round them and don't put spaces between the quotes for strings. It should be ,"[TextFieldNameInTable] = '" & var1 & "' and [NumberFieldNameInTable] = " & var2 and of course you need to replace those field names and variables with real ones or access won't recognise them.
  15. VilaRestal

    Help to create a login form?

    What's the problem - an error message or not accepting the password or too high a version of access or ...?
  16. VilaRestal

    Help to create a login form?

    When the logon form validates the user store the ID of the user in a global variable. You can then lookup the role of the user at any time in the ways shown above.
  17. VilaRestal

    MSGBOX when a form field has been left empty.

    How about something that can handle more than one required field. Put a Tag of "required"on each field's control that is required and loop through them and highlight those that aren't: Private Sub Form_BeforeUpdate(Cancel As Integer) On Error Resume Next Dim ctl As Control For Each...
  18. VilaRestal

    Define Form Size

    You can't unless you open them as dialogs or popups. Tabbed forms stretch to fill access's MDI area (there's maybe a more correct term for it). A dialog or popup form appears above the MDI area with a border and title bar and you can set its size at design or run time.
  19. VilaRestal

    Help to create a login form?

    Then, to keep it as simple as possible, you would be adding YesNo fields for those rights to the user table. Adding those fields to the user management form so they can be ticked unticked for users by the administrator. Then in the form load event of the main form check whether the current...
  20. VilaRestal

    Setting a default image on a form

    Indeed or just =Nz([FieldName],"T:\Folder\Folder\FileName.jpg") But chances are the code is looking at the field value not the control value so that would need changing too. And still there is the imperfect code that throws an error if it can't find a file.
Back
Top Bottom