Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    niall is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2014
    Posts
    12

    Quote Originally Posted by June7 View Post
    That looks like VB.net syntax. VBA would be:

    Me.txtKickOffTime.SetFocus
    Great. It worked. You lot are more of a help than my lazy teacher !

    ONE more thing (probably not) - is there anyway of taking the day from a date-formatted text box and putting that value in another box? What I mean is, I've got a combo box with the days of the week to choose from, which I input myself (not taken from a table). Then, right next to it, I've got a DATE box that has a long date format, so it comes up with the calendar style thingy. However, if the user chooses Wednesday in the DAY box, they could easily pick a DATE on the calendar that's a Thursday or Monday etc. in the DATE box, because the DAY values have no meaning as I input them myself.

    Is there any sort of validation I could do, or possibly - like I said - take the value of the DAY from the DATE box and put in into the DAY box?

    Confusing, I know. Used caps to indicate the different boxes

    This is hard! And I was thinking of doing software engineering at University

  2. #17
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,971
    Try expression in DAY box control source property:

    = Format([Date Box Name],"dddd")
    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.

  3. #18
    niall is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2014
    Posts
    12
    Quote Originally Posted by June7 View Post
    Try expression in DAY box control source property:

    = Format([Date Box Name],"dddd")
    Genius. Thanks again.

  4. #19
    niall is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2014
    Posts
    12
    Anyway, about that append query. I've completely forgotten how to do them! I've got dozens of update and select queries but I can't remember the append querys. I thought it was as simple as:
    Click image for larger version. 

Name:	Untitled2.jpg 
Views:	5 
Size:	66.1 KB 
ID:	16136- This is my attempt, but it doesn't seem to work.

    Click image for larger version. 

Name:	Untitled.jpg 
Views:	5 
Size:	41.7 KB 
ID:	16135 - this is the form where the values come from. The value from 'txtNewPlayerName' needs to append to the new record in the 'PlayerName' primary key field (see above), the value from 'txtNewSquadNumber' needs to append to this new record in the 'SquadNumber' field and the value from 'cboNewTeamName' needs to go in the 'TeamID' primary key field to the new record. Bear in mind these 3 fields will just make up 1 new record, obviously. I've just forgotten 'em!

  5. #20
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,971
    Why are you using unbound forms?

    The SQL for APPEND/INSERT in VBA behind the form would be like:

    CurrentDb.Execute "INSERT INTO tablename(SquadNumber, PlayerName, TeamID) VALUES(" & Me.SquadNumber & ", '" & Me.PlayerName & "', " & Me.TeamID & ")"

    Assumes SquadNumber and TeamID are number type and PlayerName is text.
    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.

  6. #21
    niall is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2014
    Posts
    12
    Quote Originally Posted by June7 View Post
    Why are you using unbound forms?

    The SQL for APPEND/INSERT in VBA behind the form would be like:

    CurrentDb.Execute "INSERT INTO tablename(SquadNumber, PlayerName, TeamID) VALUES(" & Me.SquadNumber & ", '" & Me.PlayerName & "', " & Me.TeamID & ")"

    Assumes SquadNumber and TeamID are number type and PlayerName is text.
    I just sort of made the forms. I didn't think the 'unbound' in the text boxes/combo boxes meant anything - just that it had no load value?

    I'll try that SQL coding. SquadNumber is a number type and TeamID and PlayerName is text.

  7. #22
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,971
    If you bind the form and bind the controls then data entry/edit will pass directly to table. No coded SQL actions necessary.
    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.

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

Similar Threads

  1. Novice Needs Help With Simple Select Queries
    By GAtkins in forum Queries
    Replies: 5
    Last Post: 11-26-2013, 04:36 PM
  2. Replies: 3
    Last Post: 07-18-2011, 08:03 AM
  3. Simple export for the Access novice
    By VictoriaAlbert in forum Import/Export Data
    Replies: 4
    Last Post: 06-15-2011, 01:33 AM
  4. Simple questions
    By canfish in forum Database Design
    Replies: 9
    Last Post: 07-23-2010, 02:57 PM
  5. Some advise for a complete novice...!
    By 450nick in forum Access
    Replies: 1
    Last Post: 09-11-2009, 02:23 AM

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