Results 1 to 4 of 4
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486

    use SetValue with different field types

    I am trying to use SetValue in a macro. I have the macro set up and it works fine if I go from a date field to a date field.

    I want to pass values from several fields concatenated with other fields into a notes field.



    For example:

    forms.form1.RentalCreditPercent & "for a total of" & forms.form1.CreditDays

    So RentalCreditPercent is a number field (percent)
    Credit days is a General Number field

    I have tried Str(forms.form1.CreditDays) but that doesnt work

  2. #2
    Bulzie is online now VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Forms![Form1]![Notes] = Forms![Form1]![RentalCreditPercent] & " for a total of " & Forms![Form1]![CreditDays]

    Or if they are on same form:
    Me.Notes = Me.RentalCreditPercent & " for a total of " & Me.CreditDays

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    what B is recommending is to use VBA rather than a macro....

  4. #4
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486
    Ok, I have converted to vba and everything is workign fine. thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 12-12-2013, 12:18 PM
  2. Replies: 11
    Last Post: 10-22-2012, 08:39 AM
  3. Changing field types
    By kwooten in forum Access
    Replies: 2
    Last Post: 06-12-2012, 07:40 AM
  4. Field Types
    By ccordner in forum Access
    Replies: 2
    Last Post: 12-13-2011, 12:33 PM
  5. Replies: 7
    Last Post: 10-25-2011, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums