Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Jacek,

    Nie, nie jestem Polakiem, ani nie mówię, nie piszę ani nie angażuję żadnego polskiego. Piszę swoje myśli po angielsku, a następnie używam google translate, aby przekonwertować mój angielski na polski. Nie chcę być krytyczne lub negatywne w tych komentarzach. Zadaję pytania, aby poznać szczegóły i rozwinąć niektóre stwierdzenia, aby poprawić przejrzystość i komunikację. Zbyt często widzę plakaty myślące, że MS Access (lub jakieś oprogramowanie) zbuduje dla nich bazę danych. Ty, jako konsultant, wiesz, że tak nie działa. Podobnie jak budowanie domu, centrum handlowego czy samolotu zaczynasz od ogólnych wymagań, od których przeprowadzasz analizę i przygotowujesz wstępny projekt. Nie rozpoczniesz centrum handlowego, projektując kolor farby na korytarzu na trzecim piętrze. Chciałbym zacząć od modelu danych, testu danych i scenariuszy, aby pokazać użytkownikom / menedżerowi / patronce, aby upewnić się, że wszyscy jesteśmy na tej samej stronie. Pomaga to w komunikacji i utrzymuje projekt tak, aby mógł być wyrafinowany. Podkreśla także błędne wyobrażenia, nieporozumienia bezpośrednio przed budową fizycznej bazy danych.



    Rozumiem, że czasami nie znamy wszystkich faktów - mamy tylko ogólne wytyczne - i musimy coś dla siebie przygotować dla osób odpowiedzialnych za projekt. Ale nie spodziewałbym się, że wniosek o wydanie zezwoleń na zbieranie i składanie sprawozdań finansowych można przeprowadzić bez uwzględnienia koncepcji projektowych. Szereg prototypów może demonstrować fakty i dane, a także wymieniać komentarze, szczegóły i udoskonalenia, które mogą poprawić prototyp i przybliżać nas do "prawdziwych wymagań / projektu".

    In my view your English is more than adequate to express your issues/comments. I have a lot of respect for June's knowledge and responses to posters. You know your situation and environment best. I have asked some questions to get a better understanding of your issue/opportunity in context, offered "my soapbox message"( po polsku) and will follow the thread with interest.

    Good luck with your project.

  2. #17
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you orange !!

    You have nice polish language ;-)

    I understand your questions and your concerns.
    I will be having it in my mind during building database and my model. Thank you.

    Thanks to June7's tips i built a model which is adequate to my business requirements.
    It is simple, all tables are connected with relationships.

    Now i have to understand how DefaultPropertyValue should work here for each document.
    (First June's method).

    So as image below:

    http://imgur.com/a/CLqFa

    when user types MonthDate and Money afterUpdate event should be run and check what is date in MonthDate Field inputed.
    When date is 2017-07-01 in the next record there should be automatically added by Access defaulyValueProperty date : 2017-08-01.

    How we can achive that?

    I was trying to set up defaultValue but it didnt work for me:


    Private Sub Form_AfterUpdate()

    Form_MainForm.tbxDate.Value = Me.MonthDate.Value


    Me.MonthDate.DefaultValue = DateAdd("m", 1, Form_MainForm.tbxDate.value)


    End Sub
    Thank you very much for your help and support once again,
    Best wishes
    Jacek Antek

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    "Didn't work" means what - error message, wrong results, nothing happens?

    Why does the code reference MainForm? That does not follow example provided in earlier post. Here it is again.

    Me.tbxDate.DefaultValue = DateAdd("m", 1, Me.tbxDate)

    Use your actual control name in place of tbxDate.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #19
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you June7 !

    I am explaining my steps:

    I have added textbox "txbDate" bound to MonthDate field:

    http://imgur.com/a/5twp2


    My code is:

    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
    
    Me.txbDate.DefaultValue = DateAdd("m", 1, Me.txbDate)
    
    
    End Sub
    When i am adding date into MonthDate for example 2017-07-14 automatically txtbox is updated for the same date (it is naturally - bound control).
    Next MonthDate should be updated to 2017-08-14, instead new record in txbDate is updated for 1905-06-17 like here:

    http://imgur.com/a/CLqFa

    I think that it is problem with date format. I set up Format to general date but this is still 1905-06-17...

    Best Wishes,
    Jacek Antek

  5. #20
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    I did a test in the VBA immediate window:

    ?DateAdd("m", 1, "2017-07-14")

    This returns 8/14/2017.

    If it is set for General date format, why is it showing YYYY-MM-DD? General date is MM/DD/YYYY.

    Looks like MonthDate field is text type, not date/time. The code must be behind the textbox bound to MonthDate field. Why did you create another textbox?

    If MonthDate is really a text type, have to do:

    Me.MonthDate.DefaultValue = """" & Format(DateAdd("m", 1, Me.MonthDate), "yyyy-mm-dd") & """"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #22
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Hi Guys,

    thank you !

    Ok it is working when code is looking like that :

    Code:
    Private Sub Form_AfterUpdate()
    
        Me.tbxDate.DefaultValue = "#" & DateAdd("m", 1, Me.tbxDate.Value) & "#"
    
    
    End Sub
    so slashes do the work.

    Ok I also added code to hide the tbxDate textbox control on form load.
    It is in order to not confuse the user.

    For all users which will be learning like me please find my sample database in attachment.
    First database and first solution is done !! wow thank you

    This week I will do also the second method provide by June and I will enclose it here.

    Thank you June7, thank you orange for your help and support.

    Warm regards,
    Jacek Antek
    Attached Files Attached Files

  8. #23
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Hi Guys,

    for all learners which want to know Access please find in attachment the second version of my sample database.

    There is a little VBA code here which is inserting MonthDate ranges automatically depending on user choice.
    I think that this can be useful for others...

    I am closing the topic,
    Best wishes,
    Jacek Antek
    Attached Files Attached Files

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 10-21-2016, 11:26 AM
  2. Next Step in Creating a db
    By CharissaBelle in forum Access
    Replies: 4
    Last Post: 06-15-2016, 05:27 PM
  3. Northwind Database Tutorial step by step
    By AATQA in forum Access
    Replies: 1
    Last Post: 10-22-2013, 06:20 AM
  4. step and step proccess
    By toochic in forum Programming
    Replies: 5
    Last Post: 10-09-2011, 09:34 AM
  5. Replies: 4
    Last Post: 04-29-2009, 04:59 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